COSC 1337 - Programming Fundamentals II
Bob Comer, Professor of Computer Studies


Assignment 1 - Expression Review

Read through Chapter 3 in your textbook before starting this assignment.

Write a C++ program that reads 2 integer values from the keyboard (be sure to print a prompt message for the user). Then calculate and print on the screen:

  1. the sum of the integers
  2. the product of the integers
  3. the average of the integers
  4. the result of dividing the first integer by the second (quotient)
  5. the remainder after dividing the first integer by the second (modulus)
Be sure to include identifying labels with your output. The screen dialog should look similar to this (user input is shown in bold):

Enter two integers: 29 8

Sum      is 37
Product is 232
Average is 18
Quotient is 3
Modulus is 5


Return to Programming Fundamentals II Home Page

Copyright: © 2013 by the Austin Community College
Department of Computer Studies. All rights reserved.
Comments to:
Bob Comer
Last updated: January 1, 2013