In Java:

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

a private instance variable currentValue that stores the current int value of the calculator
a getter method for the above instance variable
methods add, sub, mul, and div
Each method in ICalculator receives an int argument and applies its operation to currentValueand 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.

Write a public 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 whether currentValue is positive, zero, or negative respectively.

Answers

Answer 1

Answer:

A subclass?

Explanation:

Answer 2

A public subclass for ICalculator1 has one additional method, sign, that receives no arguments, and doesn't modify current Value. Instead, it simply returns 1, 0 or -1 depending on whether current Value is positive, zero, or negative respectively.

What is public subclass?

A member's access is declared to be public with the Java keyword public. All other classes can see members of the public class. This implies that a public field or method can be accessed by any other class. In addition, public fields can be changed by other public subclass or classes unless they are marked as final.

Further a subclass is defined as a class that is descended from another class (also a derived class, extended class, or child class). A superclass is the class from which a subclass is descended (also a base class or a parent class).

A public subclass for ICalculator1 has one additional method, sign, that receives no arguments, and doesn't modify current Value:

In Java,

public class ICalculator1 extends ICalculator {

public int sign() {

if (getCurrentValue() > 0)

return 1;

else if (getCurrentValue() == 0)

return 0;

else

return -1;

}

}

Therefore  the availability of an existing class, I-Calculator, that models an integer arithmetic calculator, above public subclass has been made.

Learn more about public subclass:

https://brainly.com/question/15992142

#SPJ12


Related Questions

Which computer peripheral is used when you would like to use a DVD or CD?

Answers

Answer:dvd

Explanation:

Answer:

You can use an external dvd drive via usb if your computer doesn't have one already installed

Explanation:

1 Type the correct answer in the box. Spell all words correctly. Which skill type refers to the ability to interact and communicate effectively with people? skills refer to the ability to interact and communicate effectively with people. Reset Next​

Answers

Answer:

interpersonal skills

Explanation:

please rate

Describe how to create a new folder on the desktop​

Answers

Justt create a new folder!

What are the possible effects of cyberbullying? Check all that apply.

decreased stress
poor grades
improved self esteem
increased thoughts of self harm
stomach pains

Answers

2.poor grade

4.increased thoughts of self harm

5.stomach pains

Explanation: i got it right

The possible effects of cyberbullying are poor grades, increased thoughts of self harm and stomach pains. Thus, option B, D, and E are correct.

What is cyberbullying?

Cyberbullying is basically bullying over the cybernetic world, over social media and the internet. Victims might not know who is bullying them. Cyberbullying is the act of harassment online through social media, websites, etc.

Cyberbullying is an important issue because lots of people can do it discreetly and also say things ten times worse than if they'd said it in person. If cyberbullying happens to you or someone you know you should report the accounts, delete the comments, and tell a trustworthy adult.

Therefore,The possible effects of cyberbullying are poor grades, increased thoughts of self harm and stomach pains. Thus, option B, D, and E are correct.

Learn more about cyberbullying on:

https://brainly.com/question/13688206

#SPJ3

(14) Click on the
sloping forwards
button to change the selected text to appear
(Bold Italic)​

Answers

Click on which button to change the selected text to appear sloping forward: Mouse button

What are the functions of a mouse?

To give you an idea of all the mouse capabilities, here is a list of all the computer mouse functions and options.

Move the mouse pointer on the screen - The primary function is to move the mouse pointer on the screen.

Point - After moving the mouse, you can point something out to another user or a digital object. In a game, for example, you can use the mouse to point a gun in the direction you want to shoot.

Open or run a programme - After pointing to an icon, folder, or other object, clicking or double-clicking that object opens the document or runs the programme. Some programmes even allow you to triple-click. For more information on, please visit our click page.

To know more about Mouse, click on the link :

https://brainly.com/question/14399800

#SPJ1

Determine which problem matches the given inequality. c less-than 5 and one-half There are 5 and one-half fewer cups of sugar than flour. There are 5 and one-half more cups of sugar than flour. There are less than 5 and one-half cups of sugar. There are more than 5 and one-half cups of sugar.

Answers

Answer:

There are less than 5 1/2 cups of sugar.

Explanation:

Given

[tex]c < 5\frac{1}{2}[/tex]

Required

Select a matching expression for the inequality

The inequality sign <,  mean less than

So: we can say that [tex]< 5\frac{1}{2}[/tex] means less than [tex]5\frac{1}{2}[/tex]

From the given options, only option c shows less than [tex]5\frac{1}{2}[/tex]

i.e. less than [tex]5\frac{1}{2}[/tex] cups of sugar

Hence, (c) answers the question

Answer:

C

Explanation:

2 of 10
Choosing the higher education institution with the cheapest sticker price
might be a bad idea because
sticker prices always have hidden costs which may increase the overall costs
cheaper schools usually will not allow you to apply for
financial aid
cheaper schools usually charge more for housing which is not a part of a
sticker price
more expensive schools may be cheaper once the net cost has been
determined

Answers

Answer:

D

Explanation:

Just took the test

guys tell the answer correctly ​

Answers

Answer:

1st ans: where u can see yellow colored line

2nd ans: currency one

3rd ans: cells

Explanation:

Use which command when you apply formatting to text and then want to apply the same formatting to other text in the document.​

Answers

Answer:

Use the Format Painter on the Home tab to quickly apply the same formatting, such as color, font style and size, and border style, to multiple pieces of text or graphics.

List three tasks that fall under the banner of MAM, and define their purpose.

Answers

Answer:

focus on device activation

enrollment and provisioning

licensing, configuration and maintenance

Explanation:

2. What is the use of the percent sign (6) and underscore in the LIKE clause? How do they differ in
operation and production of a report?​

Answers

Answer:

The percent sign % (or per cent sign in British English) is the symbol used to indicate a percentage, a number or ratio as a fraction of 100.

See also: U+2030 ‰ PER MILLE SIGN; U+2031 ...

Answer:

There are two wildcards used in conjunction with the LIKE operator. The percent sign represents zero, one or multiple characters. The underscore represents a single number or character.

Explanation:

There are two wildcards used in conjunction with the LIKE operator. The percent sign represents zero, one or multiple characters. The underscore represents a single number or character.

What technological development happened most recently?

A. Smartphones
B. Video Games
C. Personal computers
D. Wireless communication

Answers

Answer:

D. Wireless communication

Explanation:

Wireless communication is the technological development that happened most recently. The correct option is D.

The maximum latest technological development among the given alternatives is wi-fi verbal exchange.

Wireless verbal exchange has visible tremendous improvements in current years, permitting seamless connectivity and conversation with out the want for physical cables.

The development and big adoption of technologies like 5G, Wi-Fi 6, and Bluetooth 5.0 have revolutionized the way we join and share information.

These advancements have paved the way for quicker internet speeds, progressed community insurance, and more suitable connectivity between devices.

Wireless communication has converted numerous industries, consisting of telecommunications, IoT, clever home gadgets, and wearable generation, making it a vast and ongoing improvement in modern-day digital age.

Thus, the correct option is D.

For more details regarding Wireless communication, visit:

https://brainly.com/question/30490055

#SPJ2

Answers for 1-6 on 9.3 Lesson Practice Edhesive?

Answers

Answer:

1.two

2.row, columns

3.will

4.realize

5.fabric

6.bandana

Explanation:

If this is the quiz after the videos here are the answers that got me through it

You are a developer for a news, entertainment, lifestyle, and fashion website. User traffic has steadily increased month-over-month, and you are now tasked with cost optimizing the website. The website is currently served from an EC2 instance that is part of an auto-scaling group behind an elastic load balancer. Your manager and CTO have approved a complete re-structuring of the websites architecture in order to accommodate future growth. How would you optimize your application in the MOST cost-effective way

Answers

Answer: • Move website to a serverless application.

• Using of S3 to host the website.

• Using Lambda and API Gateway in order to support the dynamic API requests.

Explanation:

Based on the information given in the question, in order to optimize the application in the most cost-effective way, one will have to:

Move website to a serverless application.

• Using of S3 to host the website.

• Using Lambda and API Gateway in order to support the dynamic API requests.

• In determining the GCF of 3 and 1, case I applies because 3 is evenly

divisible by 1. The GCF of 3 and 1 is 1, and therefore the GCF of 7 and 3

is also 1.

hots

(a) The gcf method returns the greatest common factor of

parameters a and b, as determined by case I and case II. Write

the gcf method below. You are encouraged to implement this method

recursively

/** Precondition: a and b are positive integers.

Returns the greatest common factor of a and b, as described in part (a).

*/

public static int gcfint a, int b)

Answers

Answer:

I've added the complete code as a text attachment

Explanation:

This declares two variables as integer for input

       int f1, f2;

Prompts the user for two positive integer inputs

       System.out.print("Enter two positive integers: ");

This gets the two integer input from the user

       f1 = input.nextInt(); f2 = input.nextInt();

If both inputs are positive, the function is called and the gcf is printed

       if (f1 >0&& f2 > 0){

       System.out.printf("G.C.F of %d and %d is %d", f1, f2, gcf(f1, f2));}

If otherwise, a message is printed stating that only positive input is required

       else{            System.out.print("Positive inputs only");        }

   }

The function begins here

[tex]public\ static\ int[/tex] gcf(int a, int b) {

If the second number (b) is 0, the function returns the first number (a)

       if ([tex]b == 0[/tex]) { return [tex]a;[/tex] }

If otherwise, the function is called recursively

       else { [tex]return[/tex] (gcf([tex]b[/tex], [tex]a \% b[/tex])); }

   }

In this exercise we have to use the knowledge of computational language in C to describe the code, like this:

We can find the code in the attached image.

The code can be written more simply as:  

  int f1, f2;

Prompts the user for two positive integer inputs

      System.out.print("Enter two positive integers: ");

      f1 = input.nextInt(); f2 = input.nextInt();

      if (f1 >0&& f2 > 0){

      System.out.printf("G.C.F of %d and %d is %d", f1, f2, gcf(f1, f2));}

     else{            System.out.print("Positive inputs only");        }

  }

See more about C+ at brainly.com/question/25870717

Tom teaches in a high school. He wishes to sort a spreadsheet containing students' marks in various subjects by descending order of total
marks. While sorting the spreadsheet, what do you do before clicking the Sort option from the menu?
OA
filter the data to sort
OB.
arrange the data alphabetically
O c. select the data to sort
OD.
look up the data to sort

Answers

Answer:

Select the data to sort

Explanation:

Luis saves an attachment that he received from Kevin. Where will the attachment save by default?

on the desktop
in the documents directory
in the Outlook Archive
in the downloads directory

Answers

The folder (path) where the attachment would be saved by default is: B. in the documents directory.

What is a folder?

A folder is also referred to as a directory and it can be defined as a document that is typically used for storing and organizing an attachment or file on a computer system.

The type of folders.

In Computer technology, there are different type of folders and these include:

Downloads folderDocuments folderQuick file folderMain folderSearch folder

In this scenario, the attachment that Luis received from Kevin would be saved in the documents directory by default.

Read more on folder here: https://brainly.com/question/7697887

Answer:

in the documents directory

Explanation:

got it right on edge hope this helps

Consider the following method.
// precondition: x >= 0
public void mystery (int x)
{
if ((x / 10) != 0)
{
mystery (x / 10);
}
System.out.print (x % 10);
}
Which of the following is printed as a result of the call mystery (123456) ?

Answers

Thank you please answer my other questions from today

The output of the method call mystery(123456) will be 123456 printed on the console. The correct option is B.

What is programming?

Programming is a technological process that instructs a computer on which tasks to perform in order to solve problems.

The output of the method call mystery(123456) will be 123456 printed on the console.

The mystery method takes an integer argument x and prints the digits of x in reverse order recursively. The base case is when x is less than 10 (i.e., only one digit is left to print).

Otherwise, the method calls itself with x/10 to remove the rightmost digit, then prints the remainder of x divided by 10 (i.e., the rightmost digit).

In the case of mystery(123456), the method is called recursively as follows:

mystery(12345) prints 6mystery(1234) prints 5mystery(123) prints 4mystery(12) prints 3mystery(1) prints 2

Finally, the method is called with mystery(0) (the base case), and nothing is printed. Therefore, the output on the console is 123456.

Thus, the correct option is B.

For more details regarding programming, visit:

https://brainly.com/question/11023419

#SPJ2

Your question seems incomplete, the probable complete question is:

Consider the following method.

// precondition: x >= 0

public void mystery (int x)

{

if ((x / 10) != 0)

{

mystery (x / 10);

}

System.out.print (x % 10);

}

Which of the following is printed as a result of the call mystery (123456) ?

A) Many digits are printed due to infinite recursion.

B)123456

C)654321

D) 16

E) 56

is this even possible

Answers

Answer:

yes

Explanation:

The fastest WPM was 216 wpm

Answer:

Yes it is

Explanation: Because the 96 is how fast you typed and the 100 is what words you typed correctly.

pls answer the question

Answers

the arrow is the connector wit arrow and terminal box is the square one i dare arrow that’s all i know !

Answer:

hi

Explanation:

what is the main difference between weathering, erosion and leaching​

Answers

Erosion and weathering are the processes in which the rocks are broken down into fine particles. Erosion is the process in which rock particles are carried away by wind and water. Weathering, on the other hand, degrades the rocks without displacing them.

Does anyone know what episode Hinata threatens useless sakura?

Answers

Answer:

it was in 367 or in the 400 it was a dream that ten ten had

Explanation:

A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attending the morning session, and the list afternoonList contains the names of all children attending the afternoon session.
Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList, which will contain the names of children attending both sessions.
The following code segment is intended to create lunchList, which is initially empty.

It uses the procedure IsFound (list, name), which returns true if name is found in list and returns false otherwise.



FOR EACH child IN morningList

{



}

Which of the following could replace so that the code segment works as intended?
(A)
IF (IsFound (afternoonList, child))

{

APPEND (lunchList, child)

}

(B)
IF (IsFound (lunchList, child))

{

APPEND (afternoonList, child)

}
(C)
IF (IsFound (morningList, child))

{

APPEND (lunchList, child)

}

(D)
IF ((IsFound (morningList, child)) OR

(IsFound (afternoonList, child)))

{

APPEND (lunchList, child)

}

Answers

Answer:

The answer is "Option A".

Explanation:

In this question, the choice "A" is correct because in this a conditional if block statement is used that that use "IsFound" method that takes two parameters "afternoonList and Child" in its parameter and use the append method that takes "lunchList and child" in parameter and add values, that's why other choices are wrong.

Which of the following statements about version control are true? Select 3 options.

Early version control systems needed to use locks to keep files synchronized, but newer version control systems do not use locks at all.

With distributed version control, multiple copies of the entire project are maintained on the developers’ computers.

Version control systems can only be used by teams of developers, rather than individuals.

Git and Mercurial are examples of distributed version control systems.

In a centralized version control system, the project files are stored in a repository or database on a server

Answers

Answer:

In a centralized version control system, the project files are stored in a repository or database on a server

Git and Mercurial are examples of distributed version control systems.

With distributed version control, multiple copies of the entire project are maintained on the developers’ computers.

Explanation:

Your Welcome!

The statements about version control that are true include the following:

B. With distributed version control, multiple copies of the entire project are maintained on the developers’ computers.

D. Git and Mercurial are examples of distributed version control systems.

E. In a centralized version control system, the project files are stored in a repository or database on a server.

Version control is also referred to as source control and it can be defined as a process through which changes to a file, set of files and software codes over time, are tracked, recorded and managed, especially for easy recall and modification of specific versions in the future. A common example of a version control system that is used by software developers across the world is Git.

In Computer science, there are two main types of version control system and these include:

I. Distributed version control system.

II. Centralized version control system.

Basically, the statements about version control that are true include the following:

Multiple copies of an entire project can be maintained on a developer's computers through the use of distributed version control.Git and Mercurial are common examples of distributed version control systems.Project files are stored in a repository or database on a server in a centralized version control system.

Read more on version control here: https://brainly.com/question/14213984

You saved a file on drive C go your computer. You want to find and open the file. Which of the following programs will you use to find the saved file?

Answers

Group of answer choices.

A. Spreadsheet program

B. Microsoft Windows Explorer

C. Word-processing program

D. Notepad

Answer:

B. Microsoft Windows Explorer

Explanation:

A software can be defined as a set of executable instructions (codes) or collection of data that is used typically to instruct a computer how to perform a specific task and to solve a particular problem.

In this scenario, you saved a file on drive "C" of your computer. The software program or application which you would use to find and open the file is Microsoft Windows Explorer.

The Microsoft Windows Explorer is an inbuilt resources that avails the end users the ability to perform various operations on a file and it provides the folder paths used for the storage of user files. It is the default program for file and folder documents on a computer system.

How was the addition of

an improvement over early web design? Webpages could finally incorporate tables into the design. Webpage layout could finally format content blocks separately. O Webpage layouts were finally designed using HTML code. Webpages could finally incorporate images as layout elements.

Answers

Answer:

How was the addition of an improvement over early web design? Webpages could finally incorporate tables into the design

Which of the following statements represents the pros and cons of Internet regulations?

Answers

Answer:

Internet regulations increase net security but lead to monopolizing of services.

Explanation:

Internet regulations can be defined as standard rules or laws that restricts or control the use of the internet, as well as stating the acceptable usage of the internet in a particular location.

The pros and cons of Internet regulations is that, Internet regulations increase net security through the use of encryption and authentication proceses but lead to monopolizing of services.

A monopoly is a market structure which is typically characterized by a single-seller who sells a unique product in the market by dominance. This ultimately implies that, it is a market structure wherein the seller has no competitor because he is solely responsible for the sale of unique products without close substitutes. Any individual that deals with the sales of unique products in a monopolistic market is generally referred to as a monopolist.

For example, a public power company is an example of a monopoly because they serve as the only source of power utility provider to the general public in a society.

Answer:

Regulatory practices provide more security for the consumer but may create monopolies in the industry, reducing consumer choice.

Explanation:

edg2021

Internet regulations increase net security but could lead to monopolizing of services.  Properly done, Internet regulations benefit industry, government, and consumers by providing more online security, regulating prices for services, and decreasing liability. However, some regulations could also lead to unfair service practices, slow technological advances, and possibly contribute to technology monopolies.

5.10.4: Snake Eyes

My code:


var SENTINEL = 1;




function start(){


var diceOne;


var diceTwo;




while(true) {

println("" + diceOne + "," + diceTwo);


diceOne = Randomizer.nextInt(1,6);


diceTwo = Randomizer.nextInt(1,6);




if (diceOne && diceTwo == SENTINEL){

println("" + diceOne + "," + diceTwo);


break;


}


}

}






What am I doing wrong here?

Answers

Answer:

You didn't specify what the function actually does. BTW, good luck coding, I love coding and it is lots of fun, just stick with it!

Explanation:

Decide whether each example is representative of a paid app or a free app.

Monthly subscription for access: Paid app or free app

In app advertisements: Paid app or free app

Charge for upgrades only: Paid app or free app

Advance charge for download: Paid app or free app

Answers

1. Paid, you are paying to have access to the application

2. Free, the ads help pay for the application to be available on the store for free

3. Free app, you are not paying to use the app, but parts are paywalled

4. Paid? I am a beginning developer and I have never heard of paying extra just to download an app before...

What is the status of this account?
A)Current
B)Current, but closed
C)Potentially negative
D)Potentially negative, but closed

Answers

It’s sort of confusing to Answer if you don’t have a picture reference to describe this question
Other Questions
What is the simple interest rate for a $5,000 investmentthat become $5,750 at the end of 2 years? please help with math, Which of the following best describes the graph of the logarithmic functiongiven below? The Great Gatsby: What does this QUOTE means and who is saying this? The U.S. government is controlled through the separation of powers and a system of checks and balances. Powers are further divided into federal, state, and local government. Choose ALL reasons why these power divisions help control government. A) Checks and balances ensure one branch of government does not have too much power. B) The separation of powers divides government power into three individual branches. C) Separating government into levels allows states to make some decisions for themselves. Eliminate D) The federal government can make individual state laws for different states when needed. E) The legislative, judicial, and executive branches can all make laws at the state level. FAKE ANSWERS WILL GET REPORTED. USE OWN WORDS !PLEASE HELP !! ILL GIVE BRAINLIEST !! 100 POINTSPLEASE HELP !! ILL GIVE BRAINLIEST !! 100 POINTSPLEASE HELP !! ILL GIVE BRAINLIEST !! 100 POINTS Lisa is baking 3 cakes. Each cake needs 2-thirds cup of water. What is the total amount of water she needs?Answer options with 4 options.2 cups.3 and 2-thirds cupsC.4 and 1-half cupsD.6 cups The Founding Fathers believed strongly in limiting the number of qualifications needed to be a member of Congress. In one paragraph, using your own words, describe how the Founding Fathers established the qualifications for Congress, and why they decided that this was important. Be sure to use correct spelling, grammar, and punctuation. Redacta y contextualiza movimiento potico y reconoce su bsqueda esttica o reclamo social?? Two companies, A and B, both have $1 million in assets, earnings before interest and taxes (EBIT) of $160,000, and the same tax rate. Company A is all equity financed, and Company B is 50% debt financed and 50% equity financed. If Company B's pretax cost of debt is 8%, then Company A will have a ROA that is _____ and a ROE that is _____ than Company B's. a. Option D b. Option B c. Option A d. Option C Solve each equation Eight friends started a business. They will wear either a baseball cap or a shirt imprinted with their logo while working. They want to spend exactly $36 on the shirts and caps. Shirts cost $6 each and caps cost $3 each. How do you do in text citations in MLA format first of all? Also how do you do in text citations when your writing a quote about someone? For example Anne Frank said this quote. Would I put her as the author in parentheses or the author of the link. What do you do for in text citations when you dont have a page number? Pls give me examples!! As u can see Im confused According to the theory of plate tectonics,which of the following statements is true?A Earthquakes and volcanoes con change Earth's surface, but theoverall locations of land and ocean do not change over time.B. Continents have grown, shrunk, andmoved over the course of Earth's history.C. The ratio of ocean to land on Eorth has beenpretty much the same throughout Earth's history, La maldad es un sntoma de una sociedad corruptible.? at a high school, there are 3,510 students. the ratio of seniors to juniors to sophomores to freshmen is 4:6:5:3. How many students are in each class HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAPHELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP HELP I NEED HELP ASAP In a nuclear power plant, what is the purpose of the cooling tower?cools down the electric generatorreduces heat pollution to the environmentpumps cool water into the reactor WILL GIVE BRAINLIEST FOR THE CORRECT ANSWERSThe leaders of the group identified in question #2 aligned themselves with the:Democratic PartyKnown Nothing PartyRepublican PartyPopulist Party help meee plssssssssss