- Get a copy of
- If you download it, you might need to change the extension from .txt to .cpp
- On Hercules you can get it with this cp command:
cp /net/data/ftp/pub/class/110/expressions/readdata.txt readdata.cpp
- Or you can use your mouse to copy and paste the program into your editor
The purpose of the program is to demonstrate how to INPUT data
from the standard input device (the keyboard) and how to OUTPUT
data to the standard output device (screen) in certain format.
- Add code to the program to complete it.
- Compile and run this C++ program.
Try the input values (12, 24, 5) and (6, 12, 5).
Do you get zero cost for the latter?
If yes, check the data types of variables in the formula for calculting the cost.
You need to handle data conversion.
- Perform a screen capture of the program run or make
readdata.log file to your lab instructor.
Copyright: Department of Computer Science, University of Regina.