For this assignment, we are extending from Programming Assignment 2 (PA2) to create a true Flight planining systern 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: 899604
Joined: Mon Aug 02, 2021 8:13 am

For this assignment, we are extending from Programming Assignment 2 (PA2) to create a true Flight planining systern that

Post by answerhappygod »

For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 1
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 1 (63.84 KiB) Viewed 37 times
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 2
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 2 (63.84 KiB) Viewed 37 times
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 3
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 3 (63.84 KiB) Viewed 37 times
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 4
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 4 (58.42 KiB) Viewed 37 times
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 5
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 5 (58.47 KiB) Viewed 37 times
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 6
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 6 (74.41 KiB) Viewed 37 times
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 7
For This Assignment We Are Extending From Programming Assignment 2 Pa2 To Create A True Flight Planining Systern That 7 (55.55 KiB) Viewed 37 times
For this assignment, we are extending from Programming Assignment 2 (PA2) to create a true Flight planining systern that can process a list of wayponts. Firstly, in structs. h, define the Plane struct and Waypoint struct from PA2, don't forget the include guardst Important: Plane and Waypoint struct name must have the first character capitalized! Secondly, in flightplan. h, define a Flightplan class with the following members: Important: FightPlan class name must have the F and P capitalizedt (standard C++ practice is to use snake casing in class and struct ) names) private: - current_plane: a Plane struct that is assigned to this flight plan - waypoints a pointer that will hold the dynarne array of waypoints - num_waypoints. an int that holds the number of Waypoint that are in this flight plan public: - A overioaded constructor that takes in a Plane struct and sets current plane to it num waypoints to 0, and waypoints to nulletr - A destructor that destrcys the woypoints dynamic arroy (if it is not already nulptr) and sets it to nullptr - A copy constructor that performs a deep copy of the waypoints dynamc array - A copy assignment operator that periorms a deep copy of the waypoints dynamic array - get_curcent_plane is a function that returns the current_plane - get_waypoint is a function that takes in an index. (int) and returns the Waypoint in waypoints at positioni - set waypoint is a function that takes n an index. (int) and a Waypoint struet and sets the Waypolin at index in waypoints to that new Waypoint - save waypoints is a funct on that takes in a sting for the flename then wr tes al of the Wayporitin waypo nts into that file using the following formst <ापMAR OF WAYPONRS? cHEACINON EDISTHCE> सLIITULE?
2009003500 - Load_waypoints is a function that takes in a string for the filename and reads the file, it first reads num_waypoints (frist line), the function then creates a new dynamic array for waypoints with the new num_waypoints, then it reads all of the Waypoint from the file into the waypoints array - check_flightplan is a function that returns whether the given Plane can fiy through all Waypoint in the waypoints array. it returns true or false accordingly. This function does not take any parameters because it uses the Flightplaris current_plane and waypointsl. For each Waypoint in the waypoints array: 1. The function will first check if the Plane can reach the Waypoints altitude if the Waypoints altitude is greater than the Plane's max_altitude then return false 2. The function wil then check if the Plane has sufficient fuel to move to the Waypoint. Compute the number of hours it will take zo reach the Waypoint by dividing the Plane's speed by the Waypoint's distance houra = distance/speed Compute the fuel required by multiplying the number of hours by the fuel_usage fue1_required = fuel_uage*hourn If the fuel required is more than the Planes current fuel then return false Note: Make sure to subtract the fuel used before moving on to the next Waypoint: Lastly, the main function is provided as part of the template fles in the main function, we: - Prompt the user to enter the Planes fuel speed. fuel usage and max altude and create a Plane struct that holds these values - Create a Flightolan object and input the new Plane imo ts constructor. - Then, prompt the user to enter the filename that holds the way points - call load_waypoints from the newly created Fightplan with the filename - call check_fl1ghtplan from that fightelan, and f the resuit s true print
The flight plan in valid! elseprint: The flight plan ig not valid, pleage double-check your waypointg! Note: The save_waypoints() function will be tested in the unit tests. \begin{tabular}{l|l} LAB & 17.3.1: Programming Assignment 3: Flight Navigation System \end{tabular} Downloadable files main. cpp and planA. txt Download File is marked as read only Current file: main.cpp -
\begin{tabular}{l|l} Laa & 17.3.1: Programming Assignment 3: Flight Navigation System \end{tabular} Downloadable files main.cpp and planA.txt Download Current file: structs.h -
Downloadable files main.cpp and planA.txt Download
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply