Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A Desktop Calculator Emulator Create a b Longlnteger that represents a single long integer value in decimal (base 10). The class should have methods that

image text in transcribedimage text in transcribedimage text in transcribed

A Desktop Calculator Emulator Create a b Longlnteger that represents a single long integer value in decimal (base 10). The class should have methods that allow you to add, subtract, multiply and divide two Longlnteger objects. Each of these methods should return a new Longlnteger object or modify an existing Longlnteger. There should also be get and set methods to allow the value of the integer to be changed Derived classes implement a toString() which returns the string representation of the integer in the appropriate base Derive a class from Longlnteger called Binarylnteger, which is a binary version of Longlnteger It should be able to do all the things Longlnteger does (add, subtract, multiply, divide) by means of inheritance. Of course, the toString method needs to return a binary number in string format. Derive a class from Longlnteger called Octallnteger, which is a base 8 version of Longlnteger As with Binarylnteger, Octallnteger should have add, subtract, multiply, divide methods through inheritance. It should also have its own toString Derive a class from Longlnteger called HexInteger, which is a hexadecimal (base 16) version of Longlnteger with the same attributes and methods as the others. It should also have its own toString. Create a class IntDriver which will contain a main method. The class should do the following: 1. Present the user with a display that allows them to select one of the above four modes The user is then supposed to enter a number of that type. If the number they enter is not of the specified type, throw an exception to handle it. The type of exception you throw is up to you, but you should include the type of number expected and the input the user entered. This information should be printed to the screen (ex: Binarylnteger A Desktop Calculator Emulator Create a b Longlnteger that represents a single long integer value in decimal (base 10). The class should have methods that allow you to add, subtract, multiply and divide two Longlnteger objects. Each of these methods should return a new Longlnteger object or modify an existing Longlnteger. There should also be get and set methods to allow the value of the integer to be changed Derived classes implement a toString() which returns the string representation of the integer in the appropriate base Derive a class from Longlnteger called Binarylnteger, which is a binary version of Longlnteger It should be able to do all the things Longlnteger does (add, subtract, multiply, divide) by means of inheritance. Of course, the toString method needs to return a binary number in string format. Derive a class from Longlnteger called Octallnteger, which is a base 8 version of Longlnteger As with Binarylnteger, Octallnteger should have add, subtract, multiply, divide methods through inheritance. It should also have its own toString Derive a class from Longlnteger called HexInteger, which is a hexadecimal (base 16) version of Longlnteger with the same attributes and methods as the others. It should also have its own toString. Create a class IntDriver which will contain a main method. The class should do the following: 1. Present the user with a display that allows them to select one of the above four modes The user is then supposed to enter a number of that type. If the number they enter is not of the specified type, throw an exception to handle it. The type of exception you throw is up to you, but you should include the type of number expected and the input the user entered. This information should be printed to the screen (ex: Binarylnteger

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago