1answer.
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
Allushta [10]
3 years ago
5

How would you declare an interface named Sports that has the following (show them in your answer as well): A method called jump

that has no parameters and does not return anything. A method called throw that has one parameter called distance and is an integer and does not return anything. 2) [5 pts] Assuming the interface exist from 1) above. Give me the class header for a class named Football that would use this interface. 3) [5 pts] Assuming a parent class called GrandParents exist. How would you create a child class called GrandChild that would be a direct child of the class GrandParents
Computers and Technology
1 answer:
Artyom0805 [142]3 years ago
6 0

Answer:

See explanation

Explanation:

An interface is declared as follows:

interface interface_name{          

   member fields

   methods  }  

So the Sports interface is declared as:

interface Sports{   }  

You can also write its as:

public interface Sports { }

Now this interface has a method jump that has no parameters and does not return anything. So it is defined as:

void jump();

You can also write it as:

public void jump();

Notice that it has a void keyword which means it does not return anything and empty round brackets show that it has no parameters. Lets add this to the Sports interface:

interface Sports{  

void jump();   }    

You can write it as:

public interface Sports {

  public void void jump();  }

Next, this Sports interface has a method throw that has one parameter called distance and is an integer and does not return anything. So it is defined as:

throw(int distance);

You can also write it as:

  public void throw(int distance)

Notice that this function has a void return type and one int type parameter distance. Now lets add this to Sports interface:

interface Sports{        

   void jump();  

   void throw(int distance);   }

This can also be written as:

public interface Sports {

 public  void jump();  

   public void throw(int distance); }

Next, the class header for a class named Football that would use this interface is as follows:

class Football implements Sports{  }

You can use the methods of Sports in Football too. So the complete interface with class Football becomes:

interface Sports{  

void jump();  

void throw(int distance);

}  

class Football implements Sports{  

public void print(){

}  

public void throw(int distance) {

}

Next we have a parent class called GrandParents. So child class called GrandChild that would be a direct child of the class GrandParents is:

class GrandChild extends GrandParents {   }

Basic syntax of a parent class and its child class is:

class child_class_name extends parent_class_name

{  

  //member fields and methods

}

You might be interested in
Chapter 21 discusses four aspects of the speaking situation you should take into account when planning the graphics you'll use i
choli [55]

Answer:

The answer is "audience aptitude and experience "

Explanation:

The presentation is the ability to provide a variety of audiences with successful and stimulating interactions. The main objective of an oral presentation is to talk formally to a live audience about a particular subject. You have to write an oral speech that engages the audience and fulfills your goals.

In this type of presentation, the Listener-centric concept is effective as the productivity of a speaker is enhanced by creating and presenting the speech throughout the proper manner.

6 0
3 years ago
Write a function square_evens(values) that takes a list of integers called values, and that modifies the list so that all of its
Mice21 [21]

Answer:

#create the function

def square_evens(values):

   count_Value = 0

   #loop loop for iteration

   for i in values:

       #check for even number

       if (i) % 2 == 0:

           values[count_Value] = i * i  #store the square in the same index

       count_Value =count_Value + 1

   print(values)  #print the list

# list of integers

values = [1, 2, 3, 4, 5, 6]

#calling the function

square_evens(values)

Explanation:

The above code is written in python. first, create the function square_evens() which takes one parameter of the list.

inside the function declare the variable and then take a for loop for traversing each element in the list. Inside the for loop, we take the if-else statement for checking the number is even. if the number is even then stored the square of that value in the same list. To store the square value in the same index, we take the count variable for tracking the index.

After the all element in the list checked, the program terminates the loop and then print the updated list on the screen.

Outside the function, create the list with an integer value and then calling the function with passing the list argument.  

NOTE: In the python programming, please keep the indentation in code.

5 0
3 years ago
Please help me!! 10 Points are waiting!!
prisoha [69]

Google

https://google.com

Google has a large index of keywords and where those words can be found. Google uses a trademarked algorithm called PageRank, which assigns each Web page a relevancy score.

3 0
3 years ago
How to fix the acount when it says "Uh oh, this account has been restricted because of an unusual amount of activity.
likoan [24]

Answer:

Make sure that the email is verified. Also, usually sites do this when there are multiple log ins on multiple devices. It makes the site think that you are in multiple places at once making it seem suspicious. What i would do is clear cache and change the email and password associated with the account. If all fails contact brainly support

7 0
3 years ago
______ includes websites that encourage interaction and connection among people, businesses, and organizations.
Mice21 [21]
That answer would be, (B) Search Engines
6 0
3 years ago
Other questions:
  • If you are asked to bring in agile way of working into the way a meeting runs, which one among the listed options will you imple
    11·1 answer
  • Operating system software allows you to use your fingers, a mouse or other pointing device to select screen controls, such as bu
    5·2 answers
  • What was the name of the first computer (machine) language?
    5·2 answers
  • numbers that the user inputs. You must use JoptionPane to input the three numbers. A first method must be called and used to dev
    13·1 answer
  • When you select a state abbreviation from a combo box, how does the form control record your selection?
    8·1 answer
  • Arcade games such as Donkey Kong, Mr. Dol, and Venture were adapted from arcade titles to home consoles by which company?
    9·2 answers
  • One day you tap your smartphone screen to turn it on, and nothing happens. It appears to be turned off and will not turn on. Wha
    12·2 answers
  • Create a program that receives the age of a user and determine whether he/she can vote or not. Assume the voting age to be 20. C
    14·1 answer
  • 1. What type of malware is triggered by a specific condition, such as a specific date or a particular user account being disable
    6·1 answer
  • What maintains data about various types of objects, events, people, and places?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!