// 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

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter11: More Object-oriented Programming Concepts
Section: Chapter Questions
Problem 2FTB
icon
Related questions
Question

// 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.
Transcribed Image Text: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.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage