// 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
![Down load the Ex 7-1.cpp file from canvas. Use
notepad to create your myDVDFile.dat. The code
contains errors. Fix the errors in line 1, line 2 and the
problem with the values of the variables. Upload your
corrected program.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F7e97f612-fd91-437e-9799-43b61cd6dea4%2F82bec198-a888-4e25-bf4f-3a22e7624f87%2Fbs3krnd_processed.jpeg&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)