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
A search box does all of the following EXCEPT ________.
Rudik [331]
The answer is the first one
6 0
2 years ago
Read 2 more answers
[Assembly Language]Extended Subtraction Procedure.Create a procedure named Extended_Sub --(Receives: ESI and EDI point to the tw
alex41 [277]

Answer:

Modern (i.e 386 and beyond) x86 processors have eight 32-bit general purpose registers, as depicted in Figure 1. The register names are mostly historical. For example, EAX used to be called the accumulator since it was used by a number of arithmetic operations, and ECX was known as the counter since it was used to hold a loop index. Whereas most of the registers have lost their special purposes in the modern instruction set, by convention, two are reserved for special purposes — the stack pointer (ESP) and the base pointer (EBP).

For the EAX, EBX, ECX, and EDX registers, subsections may be used. For example, the least significant 2 bytes of EAX can be treated as a 16-bit register called AX. The least significant byte of AX can be used as a single 8-bit register called AL, while the most significant byte of AX can be used as a single 8-bit register called AH. These names refer to the same physical register. When a two-byte quantity is placed into DX, the update affects the value of DH, DL, and EDX. These sub-registers are mainly hold-overs from older, 16-bit versions of the instruction set. However, they are sometimes convenient when dealing with data that are smaller than 32-bits (e.g. 1-byte ASCII characters).

When referring to registers in assembly language, the names are not case-sensitive. For example, the names EAX and eax refer to the same register.

Explanation:

5 0
2 years ago
// This pseudocode is intended to determine whether students have
Gre4nikov [31]

Answer:

I guess you are asking for problems in this psuedocode.

- Your 'end if' statement is incomplete. It should be something like 'endif firstTest = 0' .

- Rest of the code seems fine.

6 0
1 year ago
I need to write a really simple python program to solve this issue. I have most of the program written but, when I run the secon
denis-greek [22]

Answer:

hour = float(input("Enter hour:"))

minute = float(input("Enter minute:"))

second = float(input("Enter second:"))

am_pm = input ("Enter AM or PM:")

if am_pm == "AM":

   if hour == 12:

       hour = 0

   seconds_since_midnight = ((3600 * hour) +(minute *60) + second)

elif am_pm == "PM":

   seconds_since_midnight = ((3600 * (hour+12)) +(minute *60) + second)

print("Seconds since midnight:", int(seconds_since_midnight))

Explanation:

The point here is when PM is chosen, you need to add 12 to the hour. I added <em>elif</em>  part to satisfy this. Moreover, since the output is in integer format, you may need to apply type casting for <em>seconds_since_midnight</em> variable.

4 0
2 years ago
You need to design a data storage scheme for Hayseed Heaven library data system. There are several hundred thousand large data r
Alekssandra [29.7K]

Answer:

Make use of hash tables

Explanation:

The appropriate thing to use for this should be a hash table.

A Hash Table can be described as a data structure which stores data in an associative manner. In a hash table, data is stored in an array format, where each data value has its own unique index value. Access of data becomes very fast if we know the index of the desired data. So we can perform Hashing on ISBN Number since its unique and based on the Hash Function w ecan store the Information record.

There is no requirement for printing the file in order - HashTables dont store the data in order of insertions, so no problems with that

It becomes a data structure in which insertion and search operations are very fast irrespective of the size of the data. So Querying books details can be fast and searching will take less time.

It can also be pointed out that it wont be too expensive for Hardware implemtation as HashTables stores data based on Hash Functions and memory consumption is also optimal which reduces memory wastages.

7 0
2 years ago
Other questions:
  • In an ethernet network, the signal that is sent to indicate a signal collision is called a ________ signal.
    7·1 answer
  • Pls help me. ask yourself what would jesus do...
    14·1 answer
  • Does the Boolean expression count &gt; 0 and total / count &gt; 0 contain a potential error? If so, what is it?
    8·1 answer
  • Raj needs to apply sorting to a current list in his Word document.
    11·2 answers
  • The process of __________ encourages members to accept responsibility for the outcomes of a group and for changing the style in
    8·1 answer
  • Insert the missing code in the following code fragment. This fragment is intended to call the Vehicle class's method. public cla
    14·1 answer
  • The PictureBook class is a subclass of the Book class that has one additional attribute: a String variable named illustrator tha
    9·1 answer
  • A mobile device user has tried to install a new app numerous times without success. She has closed all unused apps, disabled liv
    7·1 answer
  • (Java) Which of the following code segments correctly declare a Strings and gives it a value of "fortran".
    12·1 answer
  • You are having a problem with your Windows computer that is isolated to a single graphics editing program that you use every day
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!