COSC 1337 - Programming Fundamentals II


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


<

Creative Commons License
© Austin Community College 2016. The content on this page is licensed under a
Creative Commons Attribution 4.0 International License.
Last updated: January 1, 2013