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

Basic Java


  1. Begin a program called Arithmetic (in a file called Arithmetic.java). Import java.util.Scanner and create a new variable of type Scanner (call it keyboard).
  2. Prompt the user for two integers and use Scanner's nextInt method to retrieve these integers from the keyboard. Store them in variables with reasonable identifiers.
  3. Use System.out.println to print the result of adding, subtracting, multiplying, and dividing (integer division) the two numbers.


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