CS 1405 - Lab 5

Objective

  1. Understand arithmetic expressions

Preparation

  1. Read sections 3.1 - 3.2 (pages 85-100) from Starting Out with C++ by Gattis.
  2. Print and complete Worksheet 5.

Programming

  1. Create a project named lab05 on the Desktop of the computer and insert a new source code file into the project. Write a program to compute integer values for x, y, and z given integer values a, b, c, and d according to the following equations:

         
        x = b2 - 4ac

               a2 + c2
        y = --------
                   d2

        z = d3 - 2c2 + 3b - a
         

      Your program should:

    1. Prompt the user for values a, b, c, and d
    2. Calculate values for x, y, and z
    3. Display the values for x, y, and z
  2. Verify your program works correctly.
  3. Print the Grade Sheet.  Show your program to the instructor.

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