Write a C++ program that will create and open a data file \"YourLastNameCD.Dat\"
ID: 3647038 • Letter: W
Question
Write a C++ program that will create and open a data file "YourLastNameCD.Dat" (e.g. SmithCD.Dat) on your flash drive, which then will be read by a program 5 below for processing. The program deals with writing names of two artists, the title of their musical CD, and price to a data file using a looping control structure. Declare appropriate variables to enter following information from the keyboard and then write to a data file. Read data file created in above Program 4) - Save as: YourLNameFLab07Pg04.CPP The following program uses looping structure, decision structure, functions and File 10 concepts. You must declare appropriate variables. This program creates an integer menu options inside a do-while looping control structure executing inside main (). Inside the do-while loop, the program should ask the user repeatedly to enter one of the menu options (1, 2, or 3) using decision (if or switch statement) structure and operate as follows: Menu Optional: Inside the do-while loop, calls a function SaveNewCD () that will allow you to append new records to data file created in Program 4 by entering a new name of an artist, the title of his CD and price from the keyboard. In SaveNewCD () function test for existence of a file before writing new data to a file. (Please see * below). Use the following data when appending new records to data file created in program. Use the following data when appending new records to data file created in program Artist Name CD Title Price Seal Soul 8.99 Martin Anthology 3 13.99 Lennon A Hard Day's Night 15.99 Menu Option 2: Calls a function OpenCD () inside the do-while loop that will open the data file and display all the records to your screen. In this function use the concept to read the data to its end(EOF). Menu Option 3: Exits the do-while loop.Explanation / Answer
#include float lab, homework, test, total; char line[75]; main() { cout lab; cout homework; cout test; total = lab + homework + test; cout line; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.