CS 1405 - Lab 3

Objective

  1. Program with output statements and simple integer variables

Preparation

  1. Read sections 2.1 - 2.6 (pages 27 - 47) from Starting Out with C++ by Gattis.
  2. Print and complete Worksheet 3.

Programming

  1. 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.
  2. 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

  3. Verify both programs work correctly.
  4. Print the Grade Sheet
  5. Show your programs to the instructor.

150 East College Avenue * Ephraim, Utah 84627 * Email: ude.wons@nosneros.htrag
© 2014 Snow College * All Rights Reserved
©