Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Two part program involving writing/saving to a file. Using Bloodshed Dev-C++. Pl

ID: 3559869 • Letter: T

Question

Two part program involving writing/saving to a file. Using Bloodshed Dev-C++. Please leave comments explaing code.

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 2 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 for two records from the keyboard and then write to a data file. 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 Option 1: Inside the do-while loop, Option 1 calls a function SaveNewCD () that will allow you to append new records to data file created in Program 1 by adding 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 1. 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).

Explanation / Answer

/*Modified Program1**/

/*Modified program2*/

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote