CS 1405 - Lab 4

Objective

  1. Gain further experience with projects in the Visual C++ Environment
  2. Program with arithmetic operators
  3. Understand data types

Preparation

  1. Read Chapter 2 and Appendix M from Starting Out with C++ by Gattis, Walters, and Muganda.
  2. Print and complete Worksheet 4.

Programming

  1. Create a project named lab04a on the Desktop of the computer which is on the hard disk (drive C:) by following the steps 1-7 of Starting a New project in Appendix M of the text.
  2. Insert a new source code file into the project by following the steps 8 and 9 of Starting a New project in Appendix M of the text. The file can have the same name as the project.
  3. In the new source code file, write a program that asks the user to input the number of gallons used and the number of miles traveled by a car and then calculates the miles per gallon the car gets. Output the result on the screen.
  4. Create a project named lab04b and insert a new source code file into the project. Write a program that asks the user for a number of square feet in a tract of land and calculates the number of acres in the tract. Output the result on the screen.
  5. Create a project named lab04c and insert a new source code file into the project. Write a program that asks the user for five test scores and calculates the average. Output the result on the screen.
  6. Verify all programs work correctly.
  7. Print the Grade Sheet.  Show your programs to the instructor.
  8. Copy your source code files to your long-term storage disk and delete the projects from the Desktop folder on the hard disk.

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