Write a subclass of the memorycalc class

Assignment Help JAVA Programming
Reference no: EM131587608

Assignment

In this assignment, you will write a subclass of the MemoryCalc class from Assignment 6. This new calculator, called ScientificMemCalc, should be able to do everything that the MemoryCalc could do, plus raise the current value to a power and compute the natural logarithm of the current value. This is a fairly realistic assignment - often when you are working for a company, you will be asked to make minor extensions to existing code.

You will need to override the displayMenu method to add the new options. Be sure to only add code to the ScientificMemCalc class if it is necessary - leverage the code from the base MemoryCalc class whenever possible. Use the power of inheritance to do this rather than cutting and pasting or otherwise duplicating the code. Finally, write a new class called ScientificCalcDriver that shows the functionality of your new class. This will be very similar to the CalcDriver class contained in the assignment9.jar file.

Sample output:
The current value is 0.0 Menu
1. Add
2. Subtract
3. Multiply
4. Divide
5. Power
6. Logarithm
7. Clear
8. Quit

What would you like to do? 1 What is the second number? 20 The current value is 20.0

Menu
1. Add
2. Subtract
3. Multiply
4. Divide
5. Power
6. Logarithm
7. Clear
8. Quit

What would you like to do? 2 What is the second number? 10 The current value is 10.0

Menu
1. Add
2. Subtract
3. Multiply
4. Divide
5. Power
6. Logarithm
7. Clear
8. Quit

What would you like to do? 3 What is the second number? 3 The current value is 30.0

Menu
1. Add
2. Subtract
3. Multiply
4. Divide
5. Power
6. Logarithm
7. Clear
8. Quit

What would you like to do? 4 What is the second number? 6 The current value is 5.0

Menu
1. Add
2. Subtract
3. Multiply
4. Divide
5. Power
6. Logarithm
7. Clear
8. Quit

What would you like to do? 5 What is the second number? 2 The current value is 25.0

Menu
1. Add
2. Subtract
3. Multiply
4. Divide
5. Power
6. Logarithm
7. Clear
8. Quit

What would you like to do? 6
The current value is 3.2188758248682006

Menu
1. Add
2. Subtract
3. Multiply
4. Divide
5. Power
6. Logarithm
7. Clear
8. Quit

What would you like to do? 7 The current value is 0.0

Menu
1. Add
2. Subtract
3. Multiply
4. Divide
5. Power
6. Logarithm
7. Clear
8. Quit

What would you like to do? 8

Goodbye!

You will be graded according to the following rubric (each item is worth one point):

- The ScientificMemCalc class is a subclass of MemoryCalc
- The scientific calculator can do everything that the memory calculator can do
- The scientific calculator can raise the current value to a power and find the natural logarithm of the current value (hint: use Math.pow and Math.log)
- Your driver program allows a user to try all of the functionality in the scientific calculator
- No code from MemCalc is unnecessarily duplicated in ScientificMemCalc
- You have followed the principle of encapsulation. In particular, the currentValue field in the MemCalc class is private.
- Your program produces correct output for all inputs
- Your program compiles
- Your program runs
- You follow standard coding conventions (e.g. variable names, indentation, comments, etc.)

Reference no: EM131587608

Questions Cloud

What is b as computed by hand : State the null hypothesis where age at enrollment is used to predict the time for completion of an RN to BSN program.
Identify all relevant direct and indirect costs : Identify all relevant direct and indirect costs associated with the product category. Identify cost drivers for each activity cost pool
Which dimension of mcdonaldization is emphasized : Which dimension(s) of McDonaldization is/are emphasized? From the perspective of consumers, what are the pros and cons?
Ability to render general : Name and describe three specific utility software tools that you would pick to improve your ability to render general, but effective, user support.
Write a subclass of the memorycalc class : Write a subclass of the MemoryCalc class from Assignment 6. This new calculator, called ScientificMemCalc, should be able to do everything that the MemoryCalc
New standard desktop computers : You have just been charged with purchasing 10 new standard desktop computers. Compile a list of criteria you will use to evaluate the vendor selected.
Why do businesses produce financial statements : Why do businesses produce financial statements? What is the purpose of the notes that are attached to financial statements
Apply kendall statistical method to analyse collected data : How can I apply kendall statistical method to analyse collected data? I did a project work on 4 different industries and was asked to use kendalls correlation.
What does the suffix in this term represent : A 30-year old patient complains of pain in the fingers and wrists, and states that his job requires him to perform the same action repeatedly for hours.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd