[Solved]-User Comments Please Read Instructions Thoroughly Keep Structure Program Add Additives Nee Q37234842
****user comments: PLEASE READ INSTRUCTIONS THOROUGHLY AND KEEP THESTRUCTURE OF THE PROGRAM. JUST ADD THE ADDITIVES NEEDED
IN ORDER TO SUFFICE THE PROGRAM. PLEASE MAKE SURE IT IS IN C++ ANDWORKS! THANK YOU!****
Write a program that uses a structure to store the followinginformation for a particular month at the local airport:
Total number of planes that landed
Total number of planes that departed
Greatest number of planes that landed in a given day thatmonth
Least number of planes that landed in a given day that month
The program should have an array of twelve structures to holdtravel information for the entire year.
The program should prompt the user to enter data for eachmonth.
Once all data is entered, the program should calculate and outputthe aver- age monthly number of landing planes,
the average monthly number of depart- ing planes, the total numberof landing and departing planes for the year,
and the greatest and least number of planes that landed on any oneday (and which month it occurred in).
PROGRAM NEEDED EDITING:
// This program uses a structure to hold data about anairport.
// PLACE YOUR NAME HERE
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
struct airport // defines the structure airport
{
int landed; // planes landed in a month
int departed; // planes departured in a month
int mostLanded; // greatest number of planes landed in one day inthe month
int leastLanded; // least number of planes landed in one day in themonth
};
const int MAXMONTH = 12;
int main()
{
airport planes[MAXMONTH];
int pos; // loop counter
int totalLandings = 0; // Total landings in the year
int totalDeparted = 0; // Total departures in a year
int mostLandings = 0; // Day of most landings
int leastLandings = 99999; // Day of least landings
string monthMost; // Month that had most single day landings
string monthLeast; // Month that had least single daylandings
string month;
//add for loop to count through array
//use a switch to determine month
cout << “Please enter the number of planes that landed in” << month << “: “;
cin >> planes[pos].landed;
cout << “Please enter the number of planes that departedin ” << month << “:”;
cin >> //add code here
cout << “Please enter the greatest number of planes thatlanded on a single day in “
<< month << “: “;
cin >> //add code here
cout << “Please enter the least number of planes thatlanded on a single day in “
<< month << “: “;
cin >> //add code here
totalLandings = //add code here
totalDeparted = //add code here
if (mostLandings < planes[pos].mostLanded)
{
mostLandings = //add code here
monthMost = month;
}
if (leastLandings > planes[pos].leastLanded)
{
leastLandings = //add code here
monthLeast = month;
}
}
cout << setprecision(2) << fixed <<showpoint;
cout << “The average monthly landings for the year is”
<< (float)totalLandings/MAXMONTH << endl;
cout << “The average monthly departures for the year is”
<< (float)totalDeparted/MAXMONTH << endl;
cout << “The total landings for the year is ” <<totalLandings << endl;
cout << “The total departures for the year is ” <<totalDeparted << endl;
cout << “The greatest number of planes that landed in asingle day is “
<< mostLandings << ” which occured in the month of “<< monthMost << endl;
cout << “The least number of planes that landed in asingle day is “
<< leastLandings << ” which occured in the month of “<< monthLeast << endl;
return 0;
}
Expert Answer
Answer to ****user comments: PLEASE READ INSTRUCTIONS THOROUGHLY AND KEEP THE STRUCTURE OF THE PROGRAM. JUST ADD THE ADDITIVES NE… . . .
OR

