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
Oksi-84 [34.3K]
3 years ago
5

The superclass Calculator contains: a protected double instance variable, accumulator, that contains the current value of the ca

lculator. Write a public subclass CalculatorWithMemory, based on Calculator, a double instance variable, memory, initialized to 0 a method, save, that assigns the value of accumulator to memory a method, recall, that assigns the value of memory to accumulator a method, clearMemory, that assigns zero to memory a method, getMemory, that returns the value stored in memory
Computers and Technology
1 answer:
yawa3891 [41]3 years ago
7 0

Answer:

The following program are written in JAVA Programming Language.

//inherit the Calculator class

public class CalculatorWithMemory extends Calculator {  

   private double memory = 0.0;    //initialize double type variable

   public void save() {   //define function

       memory = accumulator;    

   }

   public void recall() {   //define function

       accumulator = memory;

   }

   public void clearMemory() {   //define function

       memory = 0;     //initialize the value

   }

   public double getMemory() {  

       return memory;    // return the value in "memory" variable

   }

}

Explanation:

Here, we inherit the property of the "Calculator" class.

Then, we define the private double type variable "memory" and assign value 0.0.

Then we set the function "save()" inside it we assign the value of "memory" in "accumulator" and close the function.

Then, we define the function "recall()" inside it we assign the value of "accumulator" in "memory" and close the function.

Then we set the function "clearMemory()" inside it we assign "memory" to 0.

After all, we set the double type function "getMemory()" inside we return the value of the "memory".

You might be interested in
When you’re in the Normal view, what are the visible panes?
zheka24 [161]

a

pleas give branlest

6 0
3 years ago
Read 2 more answers
In symmetric encryption the same key is used to encrypt and decrypt a message. in asymmetric encryption different keys are used
Brrunno [24]

A useful advantage of Asymmetric encryption over symmetric encryption is that there is no secret channel necessary for the exchange of the public key, unlike in the symmetric encryption which requires a secret channel to send the secret key.  

Another advantage of Asymmetric encryption is that is has increased security. Asymmetric uses two different keys (Public and private) for both encryption and decryption of data while symmetric uses one.

5 0
3 years ago
Read 2 more answers
Question 11
STatiana [176]

What type of program would have a class named Student with objects called fullTime and partTime?

A. machine language program

B. object-oriented program

C. markup language program

D. procedural language program

Answer:

B. object-oriented program

Explanation:

An object-oriented program or OOP is a type of program that uses the concepts of objects and methods.

Although they are quite broad, they also make use of classes and types.

Java, for instance makes use of OOP as they use classes and objects under those classes and name them anyhow they want.

Therefore, the correct answer is B

8 0
3 years ago
Raul needs to ensure that when users enter an order into the tblOrders, the shipping date is at least two days after
bagirrra123 [75]

Answer:

input mask

Explanation:

Microsoft Access is a database application used to stored data. It is a relational database with rows and columns of data tables in its database.

Data validation is a tool in Access used to put a constraint on how data is entered in the table. The input mask is a data validation type that forces users to enter data in a specified format for a given field or column.

7 0
2 years ago
Read 2 more answers
If you want to adjust the width of a column manually, move your mouse over the _______ column boundary and click and drag until
Luda [366]

Answer:

The answer is "Right".

Explanation:

In computer science, editing is the primary activity, which is used by the users to handles graphics, tables, and other things. It can be divided into two types first is internal(default) and the second is manual.

  • In the manual editing, to edit the column of the table we just right click on the column.
  • It enables you to edit option, in which we edit column according to our desire.
6 0
3 years ago
Other questions:
  • SOMEONE PLEASE HELP ASAP!!
    14·2 answers
  • The PATH environment variable.
    5·1 answer
  • A device receives a Transmission Control Protocol (TCP) packet. The device understands where the actual data payload begins. Whi
    15·1 answer
  • The__ key is used to group or identify a field or record within a table. (you don't need it).
    5·2 answers
  • One way to prepare for filing the PROFILE is to:
    12·2 answers
  • Please help me
    10·1 answer
  • I need a explanation for this 02 question for a test I will have .
    11·1 answer
  • Convert the decimal integer, 353.87510 to each of these forms:
    9·1 answer
  • EASY What does the Backspace key do?
    6·1 answer
  • Ayuda pliz es para ya!!!!!<br> nesesito un codigo html que me muestre este texto
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!