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]
4 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]4 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
based on your completed tables for ping requests and replies, which field do you think helps the network identify the appropriat
Ilia_Sergeevich [38]

Ping, a computer network management tool, is used to determine whether a host is reachable on an IP network. ARP protocols To begin, launch Wireshark and the ecet-375 Web Browsing. Pcap capture file. This capture file was created while browsing the Internet.

<h3>What does ping operates mean?</h3>
  • Ping sends an ICMP Echo Request to a predefined network interface and then waits for a response. A ping signal is sent to the specified address when a ping command is issued.
  • The destination host sends the echo reply packet in response to receiving the echo request.
  • A ping is the time it takes for a small data set to be communicated from your device to an Internet server and back to your device (latency is the more accurate technical word). Ping times are measured in milliseconds.
  • Ping is the most commonly used TCP/IP command for troubleshooting connectivity, reachability, and name resolution.
  • This command displays Help content when run without any parameters. You can also use this command to verify the computer's name as well as its IP address.

To learn more about ping operates, refer to:

brainly.com/question/14366813

#SPJ4

7 0
2 years ago
"someone has tampered with your computer and erased data". what kind of computer threat is this
pishuonlain [190]
<span>So if some access your computer and erased some data without your permission or knowing then this threat is called as security threat. So you should have these stand alone systems with username and password concept that would protect your sensitive and private data and have the control over your computer.</span>
4 0
3 years ago
Which cable between Twisted-Pair-Cable (TPC) and Coaxial-Cable (CC) work for transmitting data to more distances?
sasho [114]

Answer:

TPC is better, according to a website.

Explanation:

5 0
3 years ago
What type of security solution provides a hardware platform for the storage and management of encryption keys?
shutvik [7]

The type of security solution provides a hardware platform for the storage and management of encryption keys exists hardware security modules .

Hardware security modules (HSMs) supply an effective method to control encryption keys.

<h3>What are Hardware security modules?</h3>

A hardware security module (HSM) exists as a physical machine that supplies extra security for sensitive data. This kind of device exists utilized to require cryptographic keys for essential functions such as encryption, decryption, and authentication for the usage of applications, identities, and databases.

The hardware usually costs at least USD 20,000 to deploy, USD 40,000 for increased accessibility, and multiple periods better for normal enterprise deployment.

Hardware Security Modules (HSMs) exist in hardened, tamper-resistant hardware appliances that strengthen encryption techniques by developing keys, encrypting and decrypting data, and designing and demonstrating digital signatures.

A Hardware Security Module (HSM) exists as a hardware-based protection appliance that develops, stores, and protects cryptographic keys. Sterling Secure Proxy utilizes keys and certificates stored in its store or on an HSM.

To learn more about Hardware Security Module refer to:

brainly.com/question/24118720

#SPJ4

7 0
2 years ago
In DTP, a good rule of thumb is to use as many special effects as you need to make your documents look interesting.
Margarita [4]
It all depends back on who youre present it t

younger ages (Primary-Middle),
Its Ok to use plenty of special effects, but dont ovedue your DTP with effects, so that they still can get the point.

Older ages (High & above)
Older people usually more serious than older ages to pursue their careers, so less effect, more points


5 0
3 years ago
Other questions:
  • Which option allows you to view slides on the full computer screen? A) new slide B) slide show C) slide sorter
    11·2 answers
  • What do reservations do?
    15·1 answer
  • someone who wants the credentials of skilled training, but in less time that a four -year degree should consider
    8·1 answer
  • Can you get accurate
    6·2 answers
  • You're the administrator for a large bottling company. At the end of each month, you routinely view all logs and look for discre
    8·1 answer
  • Explain four sitting postures in a computer laboratory​
    9·1 answer
  • What is a decryption key?​
    8·1 answer
  • What are ways to create a study schedule? Check all that apply.
    5·2 answers
  • What does the "mesh" do in Augmented Reality?
    7·2 answers
  • What are the advantages of hybrid computer
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!