psudoecode

posted by .

Design a sub-class of SimpleCalculator called Calculator using psudoecode that contains public methods named multiply(), and divide() and that defines private fields called num1 and num2. Each of the methods accepts two numeric arguments and returns a number that represents the result of the appropriate Calculator operation. Design a two-arg constructor Calculator() that sets the two values num1 and num2. Design a main() method that prompts the user for two numbers and reads them in. Then creates an instance of the Calculator class setting the input values via the Calculator constructor. The main() method then tries each of the four arithmetic methods. Assume that an CalculatorException is created and thrown if the user attempts to divide by 0. Display an appropriate message when an exception is caught. If no exception, display the results from each arithmetic method call.

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Design

    Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, number of shares traded, and price per share. Include methods to set and get the values for each data field. Create the …
  2. psudoecode

    Design a sub-class of SimpleCalculator called Calculator using psudoecode that contains public methods named multiply(), and divide() and that defines private fields called num1 and num2. Each of the methods accepts two numeric arguments …
  3. Java programming

    Okay so I am rewrite the program and it's still not coming right can anyone help me see what's going wrong here please I have to turn this in by tmw so here the program The following program is supposed to read two numbers from a file …
  4. Program Design and Development

    Help on Design a class named Book that holds a stock number, author, title, price, and number of pages for a book. Include methods to get and set the values for each data field. Write the pseudocode that defines the class?
  5. Program Design and Development

    Help on Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, number of shares traded, and price per share. Include methods to set and get the values for each data field. Create …
  6. Program Design and Development

    Design a class called SimpleCalculator using psudoecode that contains public methods named add(), subtract(). Each of the methods accepts two numeric arguments and returns a number that represents the result of the appropriate arithmetic …
  7. programming

    Design a class called SimpleCalculator using psudoecode that contains public methods named add(), subtract(). Each of the methods accepts two numeric arguments and returns a number that represents the result of the appropriate arithmetic …
  8. programming

    Design a sub-class of SimpleCalculator called Calculator using psudoecode that contains public methods named multiply(), and divide() and that defines private fields called num1 and num2. Each of the methods accepts two numeric arguments …
  9. programming

    Design a sub-class of SimpleCalculator called Calculator using psudoecode that contains public methods named multiply(), and divide() and that defines private fields called num1 and num2. Each of the methods accepts two numeric arguments …
  10. Computer program and design

    Design a class called SimpleCalculator using psudoecode that contains public methods named add(), subtract(). Each of the methods accepts two numeric arguments and returns a number that represents the result of the appropriate arithmetic …

More Similar Questions