Objective
- Gain further experience with projects in the Visual C++ Environment
- Program with arithmetic operators
- Understand data types
Preparation
- Read Chapter 2 and Appendix M from Starting Out with C++ by Gattis, Walters, and Muganda.
- Print and complete Worksheet 4.
Programming
- 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.
- 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.
- 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.
- 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.
- 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.
- Verify all programs work correctly.
- Print the Grade Sheet. Show your programs to the instructor.
- Copy your source code files to your long-term storage disk and delete the projects from the Desktop folder on the hard disk.
|