
C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith
Edition 8ISBN: 978-1285867410
C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith
Edition 8ISBN: 978-1285867410 Exercise 3
Opening Files and Performing File Input
In this exercise, you use what you have learned about opening a file and getting input into a program from a file. Study the following code, and then answer Questions.
Figure 1 Code for Exercise
Consider the following data from the input file myDVDFile.dat:
Fargo 8.00 1A
Amadeus 20.00 2C
Casino 7.50 3B
a. What value is stored in the variable named dvdName?
b. What value is stored in the variable named dvdPrice?
c. What value is stored in the variable named dvdShelf?
d. If there is a problem with the values of these variables, what is the problem and how could you fix it?
In this exercise, you use what you have learned about opening a file and getting input into a program from a file. Study the following code, and then answer Questions.
Figure 1 Code for Exercise

Consider the following data from the input file myDVDFile.dat:
Fargo 8.00 1A
Amadeus 20.00 2C
Casino 7.50 3B
a. What value is stored in the variable named dvdName?
b. What value is stored in the variable named dvdPrice?
c. What value is stored in the variable named dvdShelf?
d. If there is a problem with the values of these variables, what is the problem and how could you fix it?
Explanation
The given code is used to read three val...
C++ Programs to Accompany Programming Logic and Design 8th Edition by Jo Ann Smith
Why don’t you like this exercise?
Other Minimum 8 character and maximum 255 character
Character 255