Now three isn't going to the loop. How can I prompt the user to enter the college and city five times. Enter the cost and ticket price together. What is the best way?#include "stdafx.h"
#include #include #include #include #include #include #include using namespace std;string FBTeam;string College;string location;int Price_of_Ticket;int choice;int main(){cout < "--------------------------------------------------------------------------------"=""><>cout < "="" texas="" colleges="" "=""><>cout < "--------------------------------------------------------------------------------"=""><>cout < endl=""><>vector CULIST;vector FBTEAM;{repeat:;cout < "\n\n1.="" add="" colleges="" and="" city"=""><>cout < "2.="" add="" football="" team="" and="" ticket="" price"=""><>cout < "3.="" calculate="" total="" tution."=""><>cout < "4.="" calculate="" average="" tuition="" of="" the="" schools"=""><>cout < "5.="" search="" and="" display="" information"=""><>cout < "6.="" exit\n"=""><>cout < "choose="" one:="" "=""><>cin >> choice;switch (choice){case 1:;for (int num = 0; num < 5;="">{cout < "please="" enter="" the="" college="" name:="">cin >> College;cout < "enter="" city="" of="" college:="">cin >> location;string University;University = College + location;CULIST.push_back(University);goto repeat;}case 2:;for (int num = 0; num < 5;="">{cout < "enter="" the="" football="" team="" name="" and="" cost="" of="" tickets:="">cin >> FBTeam;FBTEAM.push_back(FBTeam);goto repeat;}case 3:;for (int num = 0; num<5;>5;>{int tuition = 0;int dorm = 0;int meal = 0;float total_tuition = 0;cout < "cost="" of="" total="" tution="" for="" the="">cout < "enter="" semester="" tution:="">cin >> tuition;cout < "enter="" the="" cost="" of="" room:="">cin >> dorm;cout < "enter="" the="" cost="" of="" meal:="">cin >> meal;total_tuition = (tuition + dorm + meal);FBTEAM.resize(FBTEAM.size() + 1);cout < "total="" tution="" is="" "="">< total_tuition=""><>goto repeat;}case 4:;cout < "calculate="" average="" tuition="" of="" the="" five="" universities:="">case 5:;cout < "search="" and="" display="">goto repeat;case 6:;exit(0);default:cout < "invalid="">system("CLS");system("pause");}}return 0;}
using namespace std;
string FBTeam;string College;string location;
int Price_of_Ticket;int choice;
int main(){cout < "--------------------------------------------------------------------------------"=""><>cout < "="" texas="" colleges="" "=""><>cout < "--------------------------------------------------------------------------------"=""><>cout < endl=""><>vector CULIST;vector FBTEAM;{repeat:;cout < "\n\n1.="" add="" colleges="" and="" city"=""><>cout < "2.="" add="" football="" team="" and="" ticket="" price"=""><>cout < "3.="" calculate="" total="" tution."=""><>cout < "4.="" calculate="" average="" tuition="" of="" the="" schools"=""><>cout < "5.="" search="" and="" display="" information"=""><>cout < "6.="" exit\n"=""><>cout < "choose="" one:="" "=""><>cin >> choice;switch (choice){case 1:;for (int num = 0; num < 5;="">{cout < "please="" enter="" the="" college="" name:="">cin >> College;cout < "enter="" city="" of="" college:="">cin >> location;string University;University = College + location;CULIST.push_back(University);goto repeat;}case 2:;for (int num = 0; num < 5;="">{cout < "enter="" the="" football="" team="" name="" and="" cost="" of="" tickets:="">cin >> FBTeam;FBTEAM.push_back(FBTeam);goto repeat;}case 3:;for (int num = 0; num<5;>5;>{int tuition = 0;int dorm = 0;int meal = 0;float total_tuition = 0;cout < "cost="" of="" total="" tution="" for="" the="">cout < "enter="" semester="" tution:="">cin >> tuition;cout < "enter="" the="" cost="" of="" room:="">cin >> dorm;cout < "enter="" the="" cost="" of="" meal:="">cin >> meal;total_tuition = (tuition + dorm + meal);FBTEAM.resize(FBTEAM.size() + 1);cout < "total="" tution="" is="" "="">< total_tuition=""><>goto repeat;}case 4:;cout < "calculate="" average="" tuition="" of="" the="" five="" universities:="">case 5:;cout < "search="" and="" display="">goto repeat;case 6:;exit(0);default:cout < "invalid="">system("CLS");system("pause");}}return 0;}
cout < "\n\n1.="" add="" colleges="" and="" city"=""><>cout < "2.="" add="" football="" team="" and="" ticket="" price"=""><>cout < "3.="" calculate="" total="" tution."=""><>cout < "4.="" calculate="" average="" tuition="" of="" the="" schools"=""><>cout < "5.="" search="" and="" display="" information"=""><>cout < "6.="" exit\n"=""><>cout < "choose="" one:="" "=""><>cin >> choice;
switch (choice){case 1:;for (int num = 0; num < 5;="">
{cout < "please="" enter="" the="" college="" name:="">cin >> College;cout < "enter="" city="" of="" college:="">cin >> location;string University;University = College + location;CULIST.push_back(University);goto repeat;}
case 2:;for (int num = 0; num < 5;="">{cout < "enter="" the="" football="" team="" name="" and="" cost="" of="" tickets:="">cin >> FBTeam;FBTEAM.push_back(FBTeam);goto repeat;}
case 3:;for (int num = 0; num<5;>5;>{int tuition = 0;int dorm = 0;int meal = 0;float total_tuition = 0;cout < "cost="" of="" total="" tution="" for="" the="">cout < "enter="" semester="" tution:="">cin >> tuition;cout < "enter="" the="" cost="" of="" room:="">cin >> dorm;cout < "enter="" the="" cost="" of="" meal:="">cin >> meal;total_tuition = (tuition + dorm + meal);FBTEAM.resize(FBTEAM.size() + 1);cout < "total="" tution="" is="" "="">< total_tuition=""><>goto repeat;}case 4:;cout < "calculate="" average="" tuition="" of="" the="" five="" universities:="">
case 5:;cout < "search="" and="" display="">
goto repeat;
case 6:;exit(0);
default:cout < "invalid="">
system("CLS");system("pause");}}return 0;}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here