Objective
- Program with output statements and simple integer variables
Preparation
- Read sections 2.1 - 2.6 (pages 27 - 47) from Starting Out with C++ by Gattis.
- Print and complete Worksheet 3.
Programming
- Write a (one) program that will produce the following output twice.
A BCD EFGHI JKLMNOP QRSTUVWXYZ
The first time, use six output statments with endl to produce newlines. The second time, use one output statement with "\n" to create newlines.
- Write a program that asks the user to enter two integers, accepts the numbers, and then prints out the sum, difference, product and quotient of the two numbers. Make the user interaction portion of the program look as close to the following example as possible:
Enter first integer: 25
Enter second integer: 13
Sum is............38
Difference is ....12
Product is........325
Quotient is ......1
- Verify both programs work correctly.
- Print the Grade Sheet.
- Show your programs to the instructor.
|