Thursday
October 30, 2014

Homework Help: psudoecode

Posted by reem on Monday, July 21, 2014 at 12:47am.

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.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

psudoecode - Design a sub-class of SimpleCalculator called Calculator using ...
Java - I am supposed to convert a program i already made into a Java console ...
Java help please - I am trying to run the following program and am getting this ...
Design - Design a class named StockTransaction that holds a stock symbol (...
programming - Design a class named Book that holds a stock number, author, title...
Programming - The code below shows some of the text for a class called City. Now...
Computer Science - After reviewing an algorithm that allowed a user to enter 3 ...
programming - Design a class named Book that holds a stock number, author, title...
C++ Programming - Design and create a class named Stats that has an array of 12 ...
Computer Science - public class RandomPhoneNumber { public static void main(...

Search
Members