CS1150 (Fall 2012, Section 4): Programming Assignment 4

Selection


Instructions

  1. Begin a new Java class called SimpleCalculator. Import the Scanner class and implement the main method.
  2. Print the following menu and prompt and store the response to the prompt:
    1. Add
    2. Subtract
    3. Multiply
    4. Divide
    Your selection?
    
  3. Add to the program, prompting the user to enter two integers, and save them in variables.
  4. Implement an if ... else if ... else statement to perform the appropriate function and print the answer to the screen. If the user has entered a number that does not correspond to a menu item, print an error message.

Deliverables

Zip up only the file SimpleCalculator.java, name the resulting zip file cs1150.1208-4-yourlastname-yourfirstname-pa4.zip, and submit this file as per the syllabus.