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
nikitadnepr [17]
4 years ago
14

Create an abstract Division class with fields for a company's division name and account number, and an abstract display() method

that will be defined in the subclasses. Use a constructor in the superclass that requires values for both fields. Create two subclasses named InternationalDivision and DomesticDivision. The InternationalDivision class includes a field for the country in which the division is located, a field for the language spoken, and a constructor that requires all fields when created. The DomesticDivision class include a field for the state in which the division is located and a constructor that requires all fields when created. Write an application named UseDivision that creates two instances of each of these concrete classes.
Computers and Technology
1 answer:
Paha777 [63]4 years ago
8 0

Answer:

// SAVE IN Division.java

public abstract class Division

{

protected String name;

protected String account_number;

public Division(String nam,String ac)

{

name = nam;

account_number = ac;

}

public abstract void display();

}

// END OF Division.java

// SAVE IN InternationalDivision.java

public class InternationalDivision extends Division

{

private String country;

private String language;

public InternationalDivision(String nam, String ac,String country,String lan)

{

super(nam,ac);

this.country = country;

this.language = lan;

}

public void display()

{

System.out.println( " name of company is " + name);

System.out.println( " Account number of company is " + account_number);

System.out.println( " company located in " + country);

System.out.println( " people in that company speak " + language);

}

}

// END OF InternationalDivision.java

// SAVE IN DomesticDivision.java

public class DomesticDivision extends Division

{

private String state;

public DomesticDivision(String nam, String ac,String sta)

{

super(nam,ac);

state = sta;

}

public void display()

{

System.out.println( " name of company is " + name);

System.out.println( " Account number of company is " + account_number);

System.out.println( " company located in the state " + state);

}

}

// END OF DomesticDivision.java

// SAVE IN UseDivision.java

public class UseDivision

{

public static void main(String[] args)

{

InternationalDivision ID1 = new InternationalDivision("Hero","11223344","China","Chinesse");

ID1.display();

System.out.println();

InternationalDivision ID2 = new InternationalDivision("Honda","1122334455","Singapore","Tamil");

ID2.display();

System.out.println();

DomesticDivision DD1 = new DomesticDivision("Ford","77223344","Arizona");

DD1.display();

System.out.println();

DomesticDivision DD2 = new DomesticDivision("Maruti","6188994455","Alaska");

DD2.display();

}

}

// END OF UseDivision.java

You might be interested in
Ebay employs the _____ auction mechanism.
myrzilka [38]

Answer:

A. Foward

Explanation:

4 0
3 years ago
Read 2 more answers
Which below best describes JavaScript? *
marysya [2.9K]

Answer:

it is a programing languwage that is useualy used to program visual or text based applications

Explanation:

6 0
3 years ago
Read 2 more answers
I want to write a C++ program to read the diameter of a circle. The program should find and display the area and circumference o
Andreas93 [3]

Answer:

#include <iostream>

const double PI = 3.14159;

int main() {

   double diameter;

   std::cout << "Please enter the diameter of the circle:" << std::endl;

   std::cin >> diameter;

   double radius = diameter / 2;

   double area = radius * radius * PI;

   double circumference = 2 * radius * PI; // or diameter * PI;

   std::cout << "Area: " << area << std::endl;

   std::cout << "Circumference: " << circumference << std::endl;

}

Explanation:

The first line imports the read/write library. The rest should be self-explanatory.

std::cin is the input stream - we use it to get the diameter

std::cout is the output stream - we write the answers (and commentary) there.

std::endl is the special "character" informing the output stream that we want it to put a newline character (and actually print to the output - it might have been holding off on it).

the // in the circumference computation signifies a comment - the program simply ignores this. I've added it to tell the reader that the circumference could have been computed using the diameter,

7 0
3 years ago
380<br> 787<br> What is380+787=
nignag [31]
The awnser is 1167 ..
7 0
3 years ago
Read 2 more answers
Identify the tasks that people can perform using a web browser. View a web page Program a computer Record a video Organize the e
padilas [110]

Answer:

1,3,5,6,7,8 on edge2020

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Why is it important to save a print copy of electronic sources?
    6·1 answer
  • Ou are a web page designer and you set up a page with five different links. a user of the page can click on one of the links or
    10·1 answer
  • (a) Write a SCHEME function (make-change n den) which outputs a list of change specifications. Namely, a call (make-change 11 (l
    8·1 answer
  • Which biometric technique is considered nearly infallible from a scientific point of view and is increasingly preferred by crimi
    8·1 answer
  • Write the definition of a method, oddsMatchEvens, whose two parameters are arrays of integers of equal size. The size of each ar
    10·1 answer
  • You can create a negative indent, sometimes called a(n) ________________, by dragging the indent markers on the ruler to the lef
    12·1 answer
  • c++ Project 6: Buoyancy. Buoyancy is the ability of an object to float. Archimedes’ principle states that the buoyant force is e
    13·1 answer
  • Which of the following would not be stored in a cell ?
    14·1 answer
  • Using programming libraries is one way of incorporating existing code into new programs.
    15·1 answer
  • which one of the following portfolios cannot lie on the efficient frontier as described by markowitz? portfolioexpected returnst
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!