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
nikitadnepr [17]
2 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]2 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
Compare the encryption algorithms found in s-tools: idea, mdc, des, and 3des.
grin007 [14]
Are their answer chocies 

3 0
2 years ago
Write the execution steps if the input is a lion.
balandron [24]

Explanation:

Execution step:

1. Starting the program

2. It will get the animal name

3. Check whether the animal eats only plants. Then it prints "Herbivore". If the condition is false, it prints "carnivore".

4. Stop the program

To identify input, output and decision:

Start and Stop (oval): These are neither input nor output

Does it eat only plants?: Decision making statement ("d")

Read the names of the animals(Parallelogram): Input ("i")

Print Herbivore, Print Carnivore: Output "o"

Scenario 1: Input is lion

1. Start

2. Reads the input as "lion"

3. Check if lion eats only plants. So here it is false

4. Print "Carnivore"

5. Stop

Scenario 1: Input is Elephant

1. Start

2. Reads the input as "Elephant"

3. Check if lion eats only plants. So here it is true

4. Print "Herbivore"

5. Stop

7 0
2 years ago
In computing, a(n) _____ is an attack on an information system that takes advantage of a particular system vulnerability. Select
tensa zangetsu [6.8K]

Answer: d) Exploit

Explanation: Exploit is a type computer attack that successful when the computer system of an user is vulnerable and attacker can do the exploitation. This happens due to the weakness of the system, applications software, network etc.

Other given option are incorrect because exit door,glitch and bad are not any type of attack in the computer field that causes harm to the system.Thus the correct option is option(d).

4 0
2 years ago
LAB: Miles to track laps. (PLEASE CODE IN PYTHON)
bekas [8.4K]

Answer:

The program in python is as follows:

def miles_to_laps(user_miles):

     return (user_miles/0.25)

mile = float(input("Number of Miles: "))

print("Number of laps: ",end="")

print('{:.2f}'.format(miles_to_laps(mile)))

Explanation:

The first line defines the function miles_to_lap

def miles_to_laps(user_miles):

This line returns the equivalent number of laps

     return (user_miles/0.25)

The main method starts here

This line prompts user for input

mile = float(input("Number of Miles: "))

This line prints the string "Number of laps", without the quotes

print("Number of laps: ",end="")

This prints the equivalent number of laps to two decimal places

print('{:.2f}'.format(miles_to_laps(mile)))

3 0
2 years ago
Read 2 more answers
An oil company is investigating whether they are likely to find oil at a certain site. They will use an expert system to help th
11Alexandr11 [23.1K]
The expert system are given inputs such as questions, locations and information. The expert system processes and advice the user on what to do. If the user inputs the location of an oil site and ask a question if they are able to drill an oil out of the site, then the expert system calculates and gives you the answer you need. Though the expert system makes errors just like humans.
6 0
2 years ago
Other questions:
  • Pls help me. ask yourself what would jesus do...
    14·1 answer
  • What medium allows for electronic delivery of DTP content without the need for any physical media?
    13·1 answer
  • A simplified main program used to test functions is called
    10·1 answer
  • #A year is considered a leap year if it abides by the #following rules: # # - Every 4th year IS a leap year, EXCEPT... # - Every
    5·1 answer
  • What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
    10·1 answer
  • You are the IT security administrator for a small corporate network. Samuel Garcia (sgarcia) has been away on vacation and has f
    9·1 answer
  • Which of the following Teacher Tips would NOT be helpful when trying to select content from the Chrome Web Store? "Can be used a
    9·1 answer
  • 1.1.5 practice: analyzing business culture
    13·1 answer
  • Import simplegui
    10·1 answer
  • a key part of staying safe is employing good habits. drag the step number to the proper sequence triple a
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!