I need help making a code modular. It needsa function prototype, function definition and function call.
#include int ticketsValid(double sectionA, double sectionB, double sectionC);int totalIncome ();using namespace std;int main(){double sectionA =0;double sectionB =0;double sectionC =0;int ticketsValid(double sectionA);{ while (sectionA > 300 || sectionA <=>=> { cout<"maximum of="" 300="" seats="" in="" section="">"maximum><> cout <"enter the="" number="" of="" tickets="" sold="" in="" section="" a:="" "="">"enter> //Section A input cin >> sectionA; } int ticketsValid(double sectionB); while (sectionB > 500 || sectionB <=>=> { cout <"maximum of="" 500="" seats="" in="" section="" b"="">"maximum><> cout <"enter the="" number="" of="" tickets="" sold="" in="" sectionb:="" "="">"enter> cin >> sectionB; } int ticketsValid(double sectionC); while (sectionC > 200 || sectionC == 0) { cout <"maximum of="" 200="" seats="" in="" section="" c"="">"maximum><> cout < "enter="" the="" number="" of="" tickets="" sold="" in="" section="" c:=""> cin >> sectionC; }int totalIncome(double sectionA, double sectionB, double sectionC); { int totalIncome = (sectionA * 20) + (sectionB * 15) + (sectionC * 10); cout <"the income="" generated="" is="" $"="">"the><> } //return variables return (sectionA, sectionB, sectionC);}} }
int ticketsValid(double sectionA, double sectionB, double sectionC);int totalIncome ();
using namespace std;
int main(){
double sectionA =0;double sectionB =0;double sectionC =0;
int ticketsValid(double sectionA);{ while (sectionA > 300 || sectionA <=>=> { cout<"maximum of="" 300="" seats="" in="" section="">"maximum><> cout <"enter the="" number="" of="" tickets="" sold="" in="" section="" a:="" "="">"enter> //Section A input cin >> sectionA;
} int ticketsValid(double sectionB); while (sectionB > 500 || sectionB <=>=> { cout <"maximum of="" 500="" seats="" in="" section="" b"="">"maximum><> cout <"enter the="" number="" of="" tickets="" sold="" in="" sectionb:="" "="">"enter> cin >> sectionB; } int ticketsValid(double sectionC); while (sectionC > 200 || sectionC == 0) { cout <"maximum of="" 200="" seats="" in="" section="" c"="">"maximum><> cout < "enter="" the="" number="" of="" tickets="" sold="" in="" section="" c:=""> cin >> sectionC; }
int totalIncome(double sectionA, double sectionB, double sectionC); { int totalIncome = (sectionA * 20) + (sectionB * 15) + (sectionC * 10); cout <"the income="" generated="" is="" $"="">"the><> }
//return variables return (sectionA, sectionB, sectionC);}
} }
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here