answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dalvyx [7]
1 year ago
14

What is wrong with line 1?

Computers and Technology
1 answer:
Gelneren [198K]1 year ago
5 0

Answer:

The set is a object of the class 'H' and the setY method is a member of G class which is not called by the object of H class.

Explanation:

  • If a user calls the G function which is not a private by the help of H class objects then it can be called. It is because all the public and protected methods of A class can be accessed by the B class if B extends the A-class.
  • If any class is extended by the other class then the derived class holds the property of the base class and the public and protected method can be accessed by the help of a derived class object.
  • The derived class object can be created by the help of base class like written in the "line 1".
  • But the base class can not call the member of the derived class.
You might be interested in
Ajay wants to read a brief overview about early settlers in the United States. Which type of online text source should he most l
Tanzania [10]
Well, integrity is a must if you are reading anything. So it would be any website that has either a .edu or a .gov at the end of a URL. 

I never suggest Wikipedia for brief, since 100's of people will edit one topic at a time, the answer to what he is looking for is buried in 18 pages about one settler in the United States!
5 0
1 year ago
Read 2 more answers
Program MATH_SCORES: Your math instructor gives three tests worth 50 points each. You can drop one of the test scores. The final
Simora [160]

Answer:

import java.util.Scanner;

public class num5 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       //Prompt and receive the three Scores

       int score1;

       int score2;

       int score3;

       do {

           System.out.println("Enter first Score Enter score between 1 -50");

           score1 = in.nextInt();

       } while(score1>50 || score1<0);

       do {

           System.out.println("Enter second Score.The second score must be between 1 -50");

           score2 = in.nextInt();

       } while(score2>50 || score2<0);

       do {

           System.out.println("Enter Third Score Third score must between 1 -50");

           score3 = in.nextInt();

       } while(score3>50 || score3<0);

       //Find the minimum of the three to drop

       int min, min2, max;

       if(score1<score2 && score1<score3){

           min = score1;

           min2 = score2;

           max = score3;

       }

       else if(score2 < score1 && score2<score3){

           min = score2;

           min2 = score1;

           max = score3;

       }

       else{

           min = score3;

           min2 = score1;

           max = score2;

       }

       System.out.println("your entered "+max+", "+min2+" and "+min+" the min is");

       int total = max+min2;

       System.out.println("Total of the two highest is "+total);

       //Finding the grade based on the cut-off points given

       if(total>=90){

           System.out.println("Grade is A");

       }

       else if(total>=80){

           System.out.println("Grade is B");

       }

       else if(total>=70){

           System.out.println("Grade is C");

       }

       else if(total>=60){

           System.out.println("Grade is D");

       }

       else{

           System.out.println("Grade is F");

       }

   }

}

Explanation:

  • Implemented with Java
  • Use the scanner class to receive user input
  • Use a do.....while loop to validate user input for each of the variables. A valid score must be between 0 and 50 while(score>50 || score<0);  
  • Use if and else to find the minimum of the three values and drop
  • Add the two highest numbers
  • use if/else if /else statements to print the corresponding grade
8 0
1 year ago
Produce a list named prime_truths which contains True for prime numbers and False for nonprime numbers in the range [2,100]. We
LenKa [72]

Answer:

  1. def is_prime(n):
  2.    for i in range(2, n):
  3.        if(n % i == 0):
  4.            return False  
  5.    return True  
  6. prime_truths = [is_prime(x) for x in range(2,101)]
  7. print(prime_truths)

Explanation:

The solution code is written in Python 3.

Presume there is a given function is_prime (Line 1 - 5) which will return True if the n is a prime number and return False if n is not prime.

Next, we can use the list comprehension to generate a list of True and False based on the prime status (Line 7). To do so, we use is_prime function as the expression in the comprehension list and use for loop to traverse through the number from 2 to 100. The every loop, one value x will be passed to is_prime and the function will return either true or false and add the result to prime_truth list.

After completion of loop within the comprehension list, we can print the generated prime_truths list (Line 8).

3 0
2 years ago
If a user was complaining about a "slow computer" due to a program that uses a significant amount of memory, what part or parts
Sedaia [141]

Answer:

The Random-Access Memory (RAM) should be upgraded.

Explanation:

Since the particuar apllication is taking alot of memory space it means that an ugrade/ installation of a bigger RAM would help the system work better while using the program

6 0
1 year ago
#Write a function called string_finder. string_finder should #take two parameters: a target string and a search string. #The fun
adoni [48]

Answer:

I am writing a Python program:

def string_finder(target,search): #function that takes two parameters i.e. target string and a search string

   position=(target.find(search))# returns lowest index of search if it is found in target string

   if position==0: # if value of position is 0 means lowers index

       return "Beginning" #the search string in the beginning of target string

   elif position== len(target) - len(search): #if position is equal to the difference between lengths of the target and search strings

       return "End" # returns end

   elif position > 0 and position < len(target) -1: #if value of position is greater than 0 and it is less than length of target -1

       return "Middle" #returns middle        

   else: #if none of above conditions is true return not found

       return "not found"

#you can add an elif condition instead of else for not found condition as:

#elif position==-1    

#returns "not found"

#tests the data for the following cases      

print(string_finder("Georgia Tech", "Georgia"))

print(string_finder("Georgia Tech", "gia"))

print(string_finder("Georgia Tech", "Tech"))

print(string_finder("Georgia Tech", "Idaho"))

Explanation:

The program can also be written in by using string methods.

def string_finder(target,search):  #method definition that takes target string and string to be searched

       if target.startswith(search):  #startswith() method scans the target string and checks if the (substring) search is present at the start of target string

           return "Beginning"  #if above condition it true return Beginning

       elif target.endswith(search):  #endswith() method scans the target string and checks if the (substring) search is present at the end of target string

           return "End" #if above elif condition it true return End

       elif target.find(search) != -1:  #find method returns -1 if the search string is not in target string so if find method does not return -1 then it means that the search string is within the target string and two above conditions evaluated to false so search string must be in the middle of target string

           return "Middle"  #if above elif condition it true return End

       else:  #if none of the above conditions is true then returns Not Found

           return "Not Found"

6 0
1 year ago
Other questions:
  • Based on a kc value of 0.150 and the data table given, what are the equilibrium concentrations of xy, x, and y, respectively?
    9·1 answer
  • In an ethernet network, the signal that is sent to indicate a signal collision is called a ________ signal.
    7·1 answer
  • Prove that any amount of postage greater than or equal to 64 cents can be obtained using only 5-cent and 17-cent stamps?
    15·1 answer
  • Which social network made the mistake of alienating its early adopters by deleting suspicious accounts?​?
    5·1 answer
  • What company built its first computer from a wooden box
    12·2 answers
  • _____________ involves the deployment of malware that secretly steals data in the computer systems of organizations, such as gov
    13·1 answer
  • Susie works for an architectural firm and the partners have always drawn the plans for projects by hand. Though Susie learned ho
    11·1 answer
  • Show the stack with all activation record instances, including static and dynamic chains, when execution reaches position 1 in t
    10·1 answer
  • SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN JAVA. Assume that the classes listed in the Java Quick R
    9·1 answer
  • Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!