ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 4 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 09 May 2017 My Price 9.00

Design a class called SimpleCalculator

Please open the worksheet for problem.  It involves psudoecode.

 

Design a class called SimpleCalculator using psudoecode that contains public methods namedadd(),subtract(). Each of the methods accepts two numeric arguments and returns a number thatrepresents the result of the appropriate arithmeTc operaTon. Design a sub-class of SimpleCalculatorcalled Calculator using psudoecode that contains public methods named mulTply(), and divide() and thatdeFnes private Felds called num1 and num2. Each of the methods accepts two numeric arguments andreturns a number that represents the result of the appropriate arithmeTc operaTon. Design a two-argconstructor Calculator() that sets the two values num1 and num2. Design a main() method that promptsthe user for two numbers and reads them in. ±hen creates an instance of the Calculator class se²ng theinput values via the Calculator constructor. ±he main() method then tries each of the four arithmeTcmethods. Assume that an DivideByZero is created and thrown if the user a³empts to divide by 0. Displayan appropriate message when an excepTon is caught. If no excepTon, display the results from eacharithmeTc method call.Changes:±he four methods that the original instrucTons ask you to create. Make sure they are staTc methods.Add four new methods to the Calculator class - they will overload your current methods, they will also beinstance methods.±he four methods to add: mulTply, divide, add, and subtract. ±hey will not take any parameters and willreturn the result of applying the relaTve operaTon to the a³ribute values num1 and num2. ±hese fourmethods must call upon their overloaded counterparts to process the informaTon. ±his will require theuse of the keyword 'super' for add and subtract, and simply calling the staTc versions of mulTply ordivide sending them the appropriate data. Your main method will test all eight methods that werecreated (this requires the creaTon of a Calculator object).

Attachments:

Answers

(11)
Status NEW Posted 09 May 2017 06:05 AM My Price 9.00

-----------

Not Rated(0)