Phase 3 C++

User Generated

Gbmn

Programming

Description

hello,

I have a homework in C++, I have done phase 1 and 2 and I need help in phase 3. I have to use ((Visual Studio 2015 only)). I will drop two files. the first file is the instructions and the second file is the Phase 2. You have to use phase 2 to complete phase 3. the files are in word document. copy phase 2 code and paste it in Visual Studio 2015. After you done, make sure the code is working please. I need the new phase 3 code in word document too.

thanks

thanks

Unformatted Attachment Preview

INFS2184 C++ project files – Fall 2017 • Phase I – 150 pts. due date Oct.26 • Phase II – 500 pts. due date Nov.16 • Phase III – 500pts. due date Dec.10 *Please note that assignments turned in late will be assessed late points* C++ Project – Phase I – 150 points DUE DATE – Oct 26 (NO late programs accepted. The solution will be posted at midnight Oct 26) This will be Phase #1 of a continuous project. You will be creating the entire structure of a program that will be completed in pieces (phases) In this phase of the project, you are to make calls to functions, but the functions will have only a cout statement in them. This is called a stub. The program will call the proper function, but each function will be completed later. You are to create a program that will keep track of information for an Airline. The program will be menu driven. Your menu is to look something like the following: ACME Airline System 1. 2. 3. 4. Add/modify Flight information Add/modify Reservation information Report Section Exit Airline System Please make your selection > In this first phase you are to write the complete function for the menu and stubs for all of the other functions. The names and definitions of the functions are as follows: ▪ Menu – function that will print the above menu and will return the user’s selection by value to the main program ▪ Modify_flight– stub- to be completed in a later phase ▪ Modify_reservation- stub -to be completed in a later phase ▪ Report – stub- to be completed in a later phase You must use the above names for the functions in your program. Each function, except the menu function will just be a stub and when called, will print a message to the user that the function has been executed. Control will then pass back to the menu. You will need a while loop to keep the program running until the user picks “4.Exit Airline System “ • ▪ You are also to create two other functions called read_flight and read_reservation that will run only once at the beginning of your program. Create another function called exit_program that will run only once at the end of your program. These functions will also be stubs. - to be completed in a later phase Please copy the code to a Word document along with screen prints of the program running. Upload the document to Blackboard C++ Phase II 500 points - Due date Nov 16 You are to use the code from Phase I and add to it. You are to add code to the following functions: ✓ Read_flight • This function will be the first thing to run when your program executes. This function will open a text file called flight.dat and read flight information into parallel arrays. This data file is on blackboard and must be copied into the folder of your C++ project where your .cpp file is. The flight information that will be read in is as follows: ▪ Flight number (a four digit integer code) ▪ Flight city origin (string) ▪ Flight city destination (string) ▪ Flight date (string) ▪ Flight time (string) ▪ Flight seats(int) ✓ Read_reservation • This function run right after read_flight and will open a file called reservation.dat and read reservation information into a second set of parallel arrays. This data file is on the shell and must be copied into the folder of your C++ project where the .cpp file is. The reservation information that will be read in is as follows: ▪ Reservation code ( a four digit integer code) ▪ Flight number ( a four digit integer code) ▪ Last name (string) ▪ First name (string) ▪ Type of seat (string) business, coach, first ▪ Cost of seat (double) ✓ Report When this function is called, the following menu will print: Acme Airlines 1. All flight Info 2. All Reservation Info 3. Value of reservations of a specific type 4. All Reservations on a specific flight 5. Report 5 6. Report 6 7. Report 7 8. Report 8 9. Exit Report Menu Please make your selection > The above menu will keep running until the user selects 6. Exit Report Menu Each report is defined as follows: 1. All flight Info – Displays all information on all flights 2. All Reservation Info –Display all reservation information 3. Prompt for the type of seat and print all reservations of that type. Also calculate and print the total value of that reservation type 4. Prompt for the flight number and print the reservations on that flight 5. Reports 5,6,7,8 will be defined in phase III of the project You are to upload a word document to blackboard that contains the following: • Source code for the program • Screen shot of each report running on the screen C++ Phase III 500 points Due Date Dec 10- Nothing accepted late You are to add code to your Phase II code to do the following: 1. In this phase of the project, you are to add a user defined class. All arrays, counts and functions are to be members of this new class. Therefore, you will NOT pass any data to any functions anymore. 2. Modify_Flight – Add code to this function as follows: In this function you are to first print another menu something like the following: Modify Flight Information Menu 1. Add Flight 2. Delete Flight 3. Modify Flight 4. Exit this menu • When the user picks menu option #1, prompt the user for new flight information and store it in the parallel arrays • When the user picks menu option #2, prompt the user for the flight number, search the arrays for the flight and delete the flight from the arrays • When the user picks menu option #3, prompt the user for the flight number, search the arrays for the flight, ask the user what they want to change, (you can not change the flight number) and store the value in the proper array 3. Modify_reservation -Add code to this function as follows: This function will prompt for new reservation information and add it to the reservation arrays 4. Exit_program-Add code to this function as follows: This function will write all data from the two sets of parallel arrays back to the flight.dat and the reservation.dat files. Therefore, if the user entered new data or deleted data, the current arrays would be overwritten back to the data files. Then, the next time the program would run, that new data would be read in. 5. Report -Add code to this function as follows: In this function, you are to finish the reports. • Report #5 – All flights from a specific city – prompt the user for the city, search the flight arrays and print all flight information for flights from that city, including the count of all reservations on that flight • Report #6 – Specific reservation information – prompt the user for the reservation code, search the reservation arrays and print the information on that reservation, then also print the flight information from the flight arrays for that specific reservation • Report #7 – Summary of all flights – first print the flight information for one flight from the flight arrays, then go to the reservation arrays and print all reservations for that flight. Then go on to the next flight etc… • Report #8 – This report is of your choice You are to upload a word document to blackboard containing the following: • Your source code • Screen shots of all the reports • Screen shots of all of the additional functionality (the modify flights and reservations) Ahmed Almaghrabi 30/11/2017 #include #include #include using namespace std; int main() { void modify_reservation(); void modify_flight(); void exit_program(); int selection, i = 0; int f_count, f_num, f_seat; string f_city_dep, f_city_arrival, f_date, f_time; int r_count, r_num; string r_last, r_first, r_seat; double r_cost; //flight array int flight_number[100]; string flight_city_orgin[100]; string flight_city_destination[100]; string flight_date[100]; string flight_time[100]; int flight_seats[100]; int fcount = -1; //reservation array int reservation_code[100]; int r_flight_number[100]; string last_name[100]; string first_name[100]; string type_of_seat[100]; double cost_of_seat[100]; int rcount = -1; ifstream infile; ofstream outfile; void Report(int fcount, int flight_number[], string flight_city_orgin[], string flight_city_destination[], string flight_date[], string flight_time[], int flight_seats[], int rcount, int reservation_code[], int r_flight_number[], string last_name[], string first_name[], string type_of_seat[], double cost_of_seat[]); int menu(); int read_flight(int fcount, int flight_number[], string flight_city_orgin[], string flight_city_destination[], string flight_date[], string flight_time[], int flight_seats[]); int read_reservation(int rcount, int reservation_code[], int r_flight_number[], string last_name[], string first_name[], string type_of_seat[], double cost_of_seat[]); fcount = read_flight(fcount, flight_number, flight_city_orgin, flight_city_destination, flight_date, flight_time, flight_seats); rcount = read_reservation(rcount, reservation_code, r_flight_number, last_name, first_name, type_of_seat, cost_of_seat); selection = menu(); while (selection != 4) { if (selection == 1) { modify_flight(); } else if (selection == 2) { modify_reservation(); } else if (selection == 3) { Report(fcount, flight_number, flight_city_orgin, flight_city_destination, flight_date, flight_time, flight_seats, rcount, reservation_code, r_flight_number, last_name, first_name, type_of_seat, cost_of_seat); } selection = menu(); } exit_program(); system("pause"); return 0; } int menu() { string value; int selection; cout cout cout cout cout flight_date[fcount] >> flight_time[fcount] >> flight_seats[fcount]; } infile.close(); return fcount; }//end read_flight int read_reservation(int rcount, int reservation_code[], int r_flight_number[], string last_name[], string first_name[], string type_of_seat[], double cost_of_seat[]) { ifstream infile; infile.open("reservation.dat"); while (!infile.eof() && !infile.fail()) { rcount = rcount + 1; //read the input file infile >> reservation_code[rcount] >> r_flight_number[rcount] >> last_name[rcount] >> first_name[rcount] >> type_of_seat[rcount] >> cost_of_seat[rcount]; } infile.close(); return rcount; }//end start_program void modify_flight() { cout
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

This question has not been answered.

Create a free account to get help with this and any other question!

Related Tags