// Ex 7-1.cpp in this exercise you will use what you learned about opening a file and reading input //Read and follow the comments submit your code through the Exercise one quiz #include #include #include using namespace std; int main() { //this is the code for exercise 7-1 ofstream data_in; //find and fix the error in this line data_in.open(myDVDFile.dat); //find and fix the error in this line string dvdName, dvdPrice, dvdShelf; data_in >> dvdShelf; data_in >> dvdPrice; data_in >> dvdName; /* use notepad to create a datafile named myDVDFile.dat that contains the following data Fargo 8.00 1A Amadaus 2.00 2C Casino 7.50 3B */ //add print statements to output dvdShelf, dvdPrice, dvdName record the values in your workbooks // there is a problem with the values fix it } // End of main function
// Ex 7-1.cpp in this exercise you will use what you learned about opening a file and reading input //Read and follow the comments submit your code through the Exercise one quiz #include <fstream> #include <iostream> #include <string> using namespace std; int main() { //this is the code for exercise 7-1 ofstream data_in; //find and fix the error in this line data_in.open(myDVDFile.dat); //find and fix the error in this line string dvdName, dvdPrice, dvdShelf; data_in >> dvdShelf; data_in >> dvdPrice; data_in >> dvdName; /* use notepad to create a datafile named myDVDFile.dat that contains the following data Fargo 8.00 1A Amadaus 2.00 2C Casino 7.50 3B */ //add print statements to output dvdShelf, dvdPrice, dvdName record the values in your workbooks // there is a problem with the values fix it } // End of main function
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images