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
alisha [4.7K]
3 years ago
8

1. Create an interface called Runner. The interface has an abstract method called run() that display a message describing the me

aning of "run" to the class. Create classes called Machine, Athlete, PoliticalCandidate that all implement Runner. Create an application that demonstrates the use of the classes. Save the files as Runner.java, Machine.java, Athlete.java, PoliticalCandidate.java and DemoRunners.java
Computers and Technology
1 answer:
Colt1911 [192]3 years ago
7 0

Answer:

see explaination for program code

Explanation:

interface Runner

{

public abstract void run();

}

class Machine implements Runner

{

public void run()

{

System.out.println("Machine is running");

}

}

class Athlete implements Runner

{

public void run()

{

System.out.println("Athlete is running");

}

}

class PoliticalCandidate implements Runner

{

public void run()

{

System.out.println("Political Candidate is running");

}

}

class DemoRunners

{

public static void main (String[] args)

{

Machine m = new Machine();

m.run();

Athlete a = new Athlete();

a.run();

PoliticalCandidate pc = new PoliticalCandidate();

pc.run();

}

}

You might be interested in
Create a new Java program called MyInfo. Create one or more method(s) that pass the following information as parameters and prin
Vladimir79 [104]

Answer:

Answered below

Explanation:

//Program in Java

class MyInfo{

public static void main (String args []){

myFullName("John", "Doe");

myAgeMajorGPA(20, "Biology", 4.3);

}

public void myFullName(String initialName, String middleName){

System.out.println(initialName);

System.out.print(middleName);

}

public void myAgeMajorGPA(int age, String major, double GPA){

System.out.println(age);

System.out.println(GPA);

System.out.print(major);

}

}

3 0
2 years ago
Write a Python function that takes a positive integer N and returns the factorial of N, i.e., N! The factorial of N, denoted N!,
sesenic [268]

Answer:

The python function is as follows:

def fact(N):

   factorial = 1

   for i in range(1,N+1):

       factorial = factorial * i

   return(factorial)

Explanation:

This line defines the function

def fact(N):

This line initializes the product of 1 to N to 1

   factorial = 1

This line iterates through 1 to N

   for i in range(1,N+1):

This line calculates the product of 1 to N i.e. factorial

       factorial = factorial * i

This line returns the factorial

   return(factorial)

6 0
3 years ago
Many PC operating systems provide functionality that enables them to support the simultaneous execution of multiple applications
guapka [62]
The answer is multitasking. This is when the OS always programs to share resources to run at the same time.

If the applications were running on separate CPUs, then it would be multiprocessing.
3 0
3 years ago
When registering online for your classes you log onto to a website provided by your university. The computer and web browser tha
dedylja [7]

Answer:

Client, Server

Explanation:

The web browser acts as a client while the university computer acts as a server.

In a Server-Client model or architecture, the server provide the resources while the client request for the resources.

In this case, the university computer provide the resources that is to be consumed by the web browser after it must have made some request. The resources provided by the server (university computer) is based on the client (web browser) request.

6 0
3 years ago
Read 2 more answers
Source documents are
Bas_tet [7]

Answer:

This is the location where a document or a portion of another document was retrieved. reference: computerhope.com

3 0
3 years ago
Other questions:
  • What happens if i receive a text while my phone is off?
    15·1 answer
  • Discuss the pros and cons of tombstoning versus multitasking. Why do you think Microsoft chose tombstoning?
    11·1 answer
  • The reliance on _____ as the design methodology for relational databases is seen as a stumbling block to its use in OLAP systems
    5·1 answer
  • (70 points, ip address)If anyone can solve all these questions correctly
    7·1 answer
  • Which of the following statements is CORRECT? a. Multiple IRRs can occur only if the signs of the cash flows change more than on
    12·1 answer
  • What are the benefits of building redundancy into a network?
    12·1 answer
  • An optical fibre has an attenuation of 0.3 dB/km. If a laser launches an optical power level of PIN (mW) into 35 km length of th
    8·1 answer
  • Abby has always dreamed of having her own ice cream shop. Now as a young entrepreneur she has decided to pursue her dream, but s
    13·1 answer
  • Emily is deciding whether to buy the same designer jacket her friends have. The jacket is much more expensive than a similar one
    8·2 answers
  • You are a librarian! Ask the user for the last names of the authors of the five books they are returning. Print a list of those
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!