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
atroni [7]
3 years ago
12

Assume the availability of an existing class, ICalculator, that models an integer arithmetic calculator and contains:an instance

variable currentValue that stores the current int value of the calculatora getter method for the above instance variablemethods add, sub, mul, and divEach method in ICalculator receives an int argument and applies its operation to currentValue and returns the new value of currentValue. So, if currentValue has the value 8 and sub(6) is invoked then currentValue ends up with the value 2, and 2 is returned.So, you are to write the definition of a subclass, ICalculator1, based on ICalculator. The class ICalculator1 has one additional method, sign, that receives no arguments, and doesn't modify currentValue. Instead, it simply returns 1, 0 or -1 depending on the whether currentValue is positive, zero, or negative respectively.
Computers and Technology
1 answer:
Over [174]3 years ago
7 0

Answer:

Explanation to the approach and code given below

Explanation:

I am considering that you need only a defined subclass and not the working program.

So given statement is,  

The class  ICalculator has one additional method ,sign, that receives no arguments , and doesn't modify currentValue. Instead, it simply returns 1, 0 or -1 depending on the whether currentValue is positive, zero, or negative respectively.

Here is the code:

public class ICalculator1 extends ICalculator {

       public int sign() {

         if (currentValue != 0) {

           return currentValue * -1;}

         else {

           return 0;  

           }

       }

   }

or you can try this alternative soluton.

public int sign() {

  int value = add(0);   // add 0 and return currentValue

  if (value > 0) return 1;

  else if (value < 0) return -1;

  else return 0;

}

You might be interested in
Select the correct answer from each drop-down menu.
tia_tia [17]

Answer:

<dd> tag is used

Explanation:

The <dd> tag is used in HTML document to explain set of terms. The <dd> tag list is used in conjunction with the <dl> term. Inside a <dd> tag we can insert text, sentence, paragraph or links. There are 4 primary tags to build any website. Every HTML document begins and ends with HTML tag.

6 0
3 years ago
Which keyboard shortcut can you use to copy data from a cell? HURRY UP PLZ RIGHT NOW HURRY.
Romashka-Z-Leto [24]
The keyboard shortcut used to copy data from a cell is A.) Ctrl + c command +C

I hope this helped!! :)
7 0
3 years ago
Read 2 more answers
Several students are making presentations for a science class. The chart describes the concept that each student will present to
Sedbober [7]

Question

Student presentation concepts from another source

Letitia - a step-by-step process of breaking down glucose into energy

Mana - repeating process of the steps of the cell division, going from interphase to division, and back to interphase.

Paul - a series of organisms that show similar characteristics and compare them to those that do not

Which best describes the SmartArt graphic layout each student should use?

Answer:

Letitia would use a process, Maria would use a cycle, and Paul would use a relationship.

Explanation:

Letita's assignment requires her to show how glucose can be broken down into energy, this requires a series of steps in s linear fashion, meaning it would be best suited to a process-style diagram.

Marta's project involves showing the steps of the cell cycle: the clue is in the name. This process is not linear, and instead repeats itself, meaning it fits to a cycle diagram (i.e. a circular diagram)

Paul is comparing and contrasting different organisms. Therefore, he should use a relationship diagram to show shared characteristics as well as features that differ.

4 0
3 years ago
David bought 5.2 pounds of oranges for $1.20 per pound . how much did david spend ..............................................
Tcecarenko [31]

Answer:

David spent $6.24.

Explanation:

5.2 times 1.2

3 0
3 years ago
A chief Information Security Officer (CISO) is performing a BIA for the organization in case of a natural disaster. Which of the
nataly862011 [7]

Answer:

The correct answer is option (D) Identify the impact on safety of the property

Explanation:

Solution

In every Business Impact Analysis, the first and the most important step is for the CISO is to identify and estimate the impact of the aftereffects on the business and property of an organization that may be occurred from the disaster.

Physical security is very important, but it is not noticed by most organizations. It is important if you do not want anyone to take  away your information or destroy it, in case of natural calamity. the reason could be that, the intruder is  doing it for his personal achievement, financial gain,or seeking revenge or when one is taken unaware and becomes a target. If this security is not maintained properly all the safety measures will not be useful once the attacker gets through by gaining physical access.

Example of property can be software, equipment, facilities, company’s assets.

4 0
3 years ago
Other questions:
  • Many malware attacks are ____ attacks, which involve more than one type of malware and/or more than one type of transmission met
    6·1 answer
  • Few people will care if you use their image in a photograph without obtaining their consent. True False
    10·1 answer
  • Which symbol is used to separate a worksheet name from a cell reference?
    10·1 answer
  • In a "block" containment strategy, in which the attacker's path into the environment is disrupted, you should use the most preci
    15·1 answer
  • What are the two main things an operating system does?
    14·1 answer
  • PreparedStatement ps = connection.prepareStatement("select firstName, mi, lastName from Student where lastName = ?"; ps.setStrin
    5·1 answer
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    9·1 answer
  • How does a modem work​
    13·1 answer
  • How do you stop getting emails from brainly saying "sarah from brainly has answered your question"
    10·1 answer
  • In summary, McKibben argues that the inhabitable planet is shrinking because (select all that apply):
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!