Hello I need code of this in C++ and please it should be in iostrem library and string just that

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Hello I need code of this in C++ and please it should be in iostrem library and string just that

Post by answerhappygod »

Hello I need code of this in C++ and please it should be in iostrem library and string just that
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 1
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 1 (36.99 KiB) Viewed 41 times
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 2
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 2 (58.68 KiB) Viewed 41 times
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 3
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 3 (57.71 KiB) Viewed 41 times
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 4
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 4 (34.95 KiB) Viewed 41 times
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 5
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 5 (28.17 KiB) Viewed 41 times
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 6
Hello I Need Code Of This In C And Please It Should Be In Iostrem Library And String Just That 6 (29.72 KiB) Viewed 41 times
Second Semester 2021-2022 Deadline: Saturday 21/5/2022 (10:00 a.m.) We would like to implement a system for Saudia Airlines to manage domestic flights information the system should enable the Flight Data Manager to complete some tasks such as: Add a new flight to the flights list Find the information of a flight given its umbet Print all tights Print all flights in a given month Update departure time and arrival time of a specific flight Print total number of flights. + The first step we would like to do is to declare a global variable sotul Flights to keep track of the total number of flights added to the system. + The second step is to define the class Flight. The UML for class Flight is: Flight - flightNowing destinationering -gate.nl - date: string - departure Time string - rivalTimestring - Flight + Flighetstring destingstringd, string diep Time) * selline string dest, int 3. string, string dep Time} void generateFlightNovoid +calculate ArrivalTime: void prin lightfot vaid get lighting getDeparture Timering getArrival Timel string gaat string setDeparture Timestring die void Attributes • flightNo To represent light number destination To represent the destination city. There a bit of 7 destinations to choose from which we Dammam, Jeddah, Yanbu, HailAbu Tabuk and Taif • gate To represent the gate number for a flight • date Te represent the flight date in the format ddmm • departure Time To represent the departure time in the fathem were 34 bous system is applied. . arrival Time To represent the arrival time in the format (cm) where 24-hour system is applied.

Attributes • NightNo To represent flight number. • destination to represent the destination city. There is a list of 7 destinations to choose from which are: Dammam, Jeddah, Yanbu, Hail, Abha, Tabuk and Taif. gate To represent the gate number for a flight. date To represent the flight date in the format (dd/mm). departure Time To represent the departure time in the format (hh:mm) where 24-hours system is applied. arrival Time To represent the arrival time in the format (hh:mm) where 24-hours system is applied. Constructors • Flight A default constructor that initializes all attributes, integers are initialized to zero and strings are initialized to null Flight(string dest, int g, string d, string depTime) Another constructor that initializes a flight with initial values for all the attributes by calling the function setAllInfo. Functions setAllInfo() It set all the flight attributes as follows: (1) set destination, gate, date and departure Time from the received parameters: (i) set arrival Time by calling the function calculate Arrival Time(): and set flightNo by calling the function generate FlightNo. generate FlightNo0lt generates and stores a flight number in flightNo. The flight No is formed as follows: the first three characters in the destination (in uppercase) followed by "00" and concatenated with the totalFlights number Example: If the destination is Dammam and the current totalFlights is 3 → flightNo is DAM003 • calculate ArrivalTime) It calculates arrivalTime based on the destination and the duration of the flight. It then checks whether the arrival time will be in the next day or not. If so, it adds +1" beside arrival Time. Example: If the destination is Dammam and departure Time is 02:15 → arrival Time is 03-20 If the destination is Jeddah and departure Time is 23:30 — arrival Time is 01:15+1 The following table shows the duration of time between Riyadh and each city: Duration 65 minutes City Dammam Jeddah, Yanbu and Abha Hail 105 minutes 75 minutes 80 minutes 95 minutes Tabuk Taif

printFlightInfo() It prints the information of a flight in the following format: Flight Number: flightNo Destination: destination Departure Time: departure Time Gate:gate Date: date Amival Time: arrival Time Setters + Getters as needed (shown in UML). + After that we need to implement some functions for the system. Before that, we need to declare 10 global objects of type Flight (11,2,3,... [10). The functions are as follows: . addFlight(string dest, int g, string d, string dep Tim) It adds the information of the received parameters to the next available flight object, starting from 11, 12,.., and so on. It then retums true if the add operation is completed successfully, and false otherwise. The flight is successfully added if the number of the current flights does not exceed 10, and if date and departure time has a correct format. The correct format for the date is /e and correct format for the for departure time is : • findFlight(string no) It returns the index of the flight with the received flight number no if found, and -1 otherwise. Knuwing that object fl has index 1, object 12 has index 2 and so on. . listFlights) It prints all flights" information in the list. It prints an appropriate message in case there is no flight • listFlightin Month(int m) lt prints all flights information that are departed in the received month. It prints an appropriate message in case there is no flight in that month. • update FlightTime(string no) It updates departure and arrival times of the received flight number no by reading departure time from user. It then validates it, if it follows the same format, and repeatedly asks the user to re-enter again in case it is invalid.The function updates the flight and prints an appropriate message after update in case the flight is found. Otherwise, it prints another message. • isValidNum(string str) It checks the received string str if valid or not. The string stris valid if it is consists of five characters, and both the first two characters and the last two characters are digits. The function returns true if str is valid, false otherwise. Now we reach the final step, which is festing your system in the main function. In the main function, a list will be repeatedly displayed to the user with the following options: 1. Add a flight 2. Find a flight 3. List all flights 4. List flights for a given month. 5. Update departure & arrival time. 6. Display the total number of flights. 7. Exit

(1) Read all information from user, and add it to the next flight object. Print an appropriate message to tell if the add operation is done successfully or not. (2) Ask the user to enter a flight number. Then, if found, print the flight index (fl has index 1,12 has index 2..etc.) along with the flight information. Print an appropriate message to tell if the flight is not found (3) List all flights information added to the system, if any. (4) Ask the user to enter a month and then list all flights information scheduled in that month, if any. (5) Ask the user to enter a flight number and the new departure time, then update the departure time (and arrival time accordingly) of that flight. (6) Display the number of total flights added. (1) Exit the system Important Points Date and departure time should be checked before adding the flight The flights are added in a sequence, first flight should be added to object fl and next one to object 12 and . Suppose that user will always enter valid data. No need to check user entry other than those mentioned previously. All flights are departing from Riyadh There is a counter for the number of flights, the totalFlights will be incremented whenever a flight is added Successfully Appropriate message should be displayed when the user chooses an invalid choice from the list. You need to search about converting strings to integers and vice versa! so on.

Sample Run: **Welcome to Saudia Airlines *** 1. Add a flight 2. Find a flight 3. List all flights 4. List flights for a given month 5. Update departure & arrival time 6. Display the total number of flights. 7. Exit Enter your choice No flights added 1. Add a flight 2. Find a flight 3. List wil flights 4. List flights for a given month 5. Update departure & arrival time 6. Display the total number of flights. 7. Exit Enter your choice Invalid choice! Try again 1. Add a flight 2. Find a flight 3. List all flights 4. List flights for a given month 5. Lipdate departure & arrival time. 6. Display the total number of flights 7. Exit Enter your choice1 Enter destination >> Dammam Enter gate 12 Enter date in the format (ddmm) 154 Enter departure time in the format (hh:mm)>>3:15 Flight is not added successfully 1. Add a flight 2. Find a flight 3. List all flights 4. List flights for a given month 5. Update departure & arrival time. 6. Display the total number of flights. 7. Exit Enter your choice Enter destination Duam Enter gate 12 Enter date in the format (ddmm) 1505 Enter departure time in the format (hh:mm) >>03:15

Fntergate > 12 Enter date in the format (dd) 150 Enter departure time in the format hem) 08:15 Flight is added successfully 1. Add a flight 2. Find a flight 3. List all flights 4. List flights for a given month 5. Update departure & arrival time 6. Display the total number of flights 7. Exit Enter your choice Enter destination >> Ah Entergale >> Enter date in the format (dm) 110 Enter departure time in the format (hmm) 33.00 Flight is added recessfully 1. Add a flight 2. Find a flight 3. List all flights 4. List flights for a given months 5. Update departure & arrival time 6 Display the total number of flights 7. Exit Enter your choice Enter destination de Enter yale » Enter date in the format (ddmm) 1104 Enter departure time in the format (bum) Flight is added accessfully 1. Add a flight 2. Find a flight 3. List all light 4. Littlights for a given month Update depurture & arrival time 6 Display the total number of flights 7. Exit Enter your choice Enter flight number DAMODO Flight DAMO is found at index Flight Number: DAMOOO Destination. Dammam Gate: 12 Date: 1504 Departure Time: 0.15 ce Arrival Time: 0420
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply