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
VARVARA [1.3K]
4 years ago
9

Banks and other financial service companies offer many types of accounts for client's to invest their fund-- every one of them h

as a notion of their current value, but the details of calculating such value depend upon the exact nature of the account.
Write an abstract class, Account, with the following:

1. an integer static variable, nextId initialized to 10001 2. an integer instance variable, id
3. a string instance variable name
4. a constructor that accepts a single string parameter used to initialize the name instance variable. The constructor also assigns to id the value of nextId which is then incremented.
5. two accessor methods, getId, and getName which return the values of the corresponding instance variables
6. an abstract method named getValue that accepts no parameters and returns an object of type Cash.
Computers and Technology
1 answer:
monitta4 years ago
6 0

Answer:

//Abstract class declaration of Account

public abstract class Account{

   

   //nextId initialized to 10001

   private static int nextId = 10001;

   private int id;

   private String name;

   // constructor with one argument

   public Account(String passName){

       name = passName;

       //assign the value of nextId to id

       id = nextId;

       //nextId is incremented

       nextId++;

   }

   // accessor method to return id

   public int getId(){

       return id;

   }

   // accessor method to return name

   public String getName(){

       return name;

   }

   //abstract method that return object of type Cash

   //It is not implemented here.

   //It will be overriden and implemented by concrete subclassed

   public abstract Cash getValue();

}

Explanation:

The abstract class Account is defined with the keyword abstract. Then inside the class, we declared and initialized an integer static variable nextId, an instance variable id and a String instance variable name.

A constructor is then defined which accept one argument of a string passName.

Two accessor methods getId and getName are declared. getId return an integer id, while getName return a string name.

Finally, an abstract method getValue is declared with no implementation and it return an object of type Cash.

You might be interested in
_________ is the method used by password crackers who work with pre-calculated hashes of all passwords possible within a certain
sergij07 [2.7K]

Answer:

DOS, Denail of Service Attacks

Explanation:

5 0
2 years ago
Convert to octal. Convert to hexadecimal. Then convert both of your answers todecimal, and verify that they are the same.(a) 111
melomori [17]

The given decimal values are converted to octal and hexadecimal.

Explanation:

a. The converted octal value of 111010110001.0112 decimal number is  1473055755061.00557000643334272616

The converted hexadecimal value of 111010110001.0112 decimal number is  19D8B7DA31.02DE00D1B71758E21965

b. The converted octal value of 10110011101.112 decimal number is  113246503335.07126010142233513615

The converted hexadecimal value of  10110011101.112 decimal number is  

25A9A86DD.1CAC083126E978D4FDF4

a. while converting back from octal to decimal the value is 111010110001.01119999999999999989

b. while converting back from octal to decimal the value is

10110011101.11199999999999999973

Hence both the values changes while we convert from octal to decimal.

3 0
3 years ago
__________ may be defined as the application of methods and means to ensure that test results are reliable and valid, and errors
kow [346]

Answer:

Quality assurance

Explanation:

8 0
3 years ago
If the current through a heater coil is 5 amp and the supply voltage is 120 volts, the coil resistance is A. 0.04 ohm. B. 24 ohm
Scorpion4ik [409]
V = i.r
120v = 5A x r
Resistance = 120:5 = 24 ohm
7 0
4 years ago
Widget Corp. wants to shift its list of inventory to a cloud so that its different branches can access it easily. The company ne
____ [38]

Answer:

The best cloud option for Widget Corp considering the cloud computing option should be cost-effective and should not expose mission-critical applications and data to the outside world.

Is a hybrid could.

Explanation:

The reasons behind this answer are that in the first place the cloud is not going to be fully managed by a third party, but also by the IT department of Widget Corp allowing it to control its security. Also, that the cloud can be adapted to public or mainstream sources, resources, and platforms. Making it very user friendly and lowering down specific knowledge to use it.

5 0
4 years ago
Other questions:
  • Charles Lyell believed that:
    7·1 answer
  • The number of bits used to store color information about each pixel is called ____.
    13·1 answer
  • HTML code must be enclosed in the _______ (angle brackets) so the browser can tell the difference between code and content you w
    6·2 answers
  • What is the purpose of filters in a database?
    15·1 answer
  • Write a short Python function, is_multiple(n, m), that takes two integer values and returns True is n is a multiple of m, that i
    9·1 answer
  • Explain how inflation flattens the universe
    6·2 answers
  • Which organization has published more than 300 web standards
    7·1 answer
  • How do cyber criminals target user’s end devices?
    11·2 answers
  • Which of the following is/are used in multimedia?
    14·1 answer
  • 9. Which of the following will best protect your computer from viruses and hackers?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!