Exercise #1
- Use
ex1_readdata.cpp
in Visual Studio project or copy the following code into your IDE:
The purpose of the program is to practice prompting for INPUT from the standard input device (the keyboard) and to demonstrate OUTPUT to the standard output device (screen) with formatting.
- Add code and comments to the program to complete it.
- Compile and run this C++ program.
Try these input values:- (length: 12, width: 24, price: 5)
- (length: 6, width: 12, price: 5)
Do you get zero cost for the latter?
If yes, check the data types of variables in the formula for calculating the cost.
You need to handle data conversion.
When you are done:
- Take a screenshot of your IDE and console window after running the program with both input values (above)
- For this exercise, you have added comments and code to
ex1_readdata.cpp
. Complete all the exercises in this lab and upload the .cpp files and the corresponding screenshots for the output.