Case # 4 is bold where I am stuck. I am trying to list the College input Case 1. I have it input but it only shows the last inser. How do I input the first to last from the college function

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Case # 4 is bold where I am stuck. I am trying to list the College input Case 1. I have it input but it only shows the last inser. How do I input the first to last from the college function 

 

#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>
#include <vector>
#include <cctype>
#include <iterator>
#include <algorithm>
#include <cmath>
#include "ConsoleApplication11.h"

using namespace std;

string FBTeam;
string College;
string location;
string Price_of_Ticket;
int choice;


int main()
{
vector<string> CULIST(5);
vector<string> FBTEAM(5);
string itemNumber;

int num;
int tuition = 0;
int dorm = 0;
int meal = 0;
int total_tuition = 0;
int average;

const int size = 5;
double averages[size] = { 0.0 };
bool stop = false, itemFound;


cout << "--------------------------------------------------------------------------------" << endl;
cout << " Colleges in Texas "<< endl;
cout << "--------------------------------------------------------------------------------" << endl;
cout << endl
<< endl;


{
repeat:;
cout << "\n\n1. Add Colleges and City" << endl;
cout << "2. Add Football Team and Ticket Price" << endl;
cout << "3. Calculate Total Tution." << endl;
cout << "4. Calculate Average Tuition of the schools" << endl;
cout << "5. Search and Display Information" << endl;
cout << "6. Exit\n"
<< endl;
cout << "Choose one: \n" << endl;
cin >> choice;
switch (choice)
{
case 1:
for (vector<string>::size_type num=0; num < 5; num++)
{
cout << "Please enter the name for college # " << (num + 1) << ": \n";
cin >> College;
CULIST.push_back(College);
cout << "Enter city of College # "<<(num+1)<< ": \n";
cin >> location;
string University;
University = College + " - " + location;
CULIST.push_back(University);
}
goto repeat;
case 2:
for (int num = 0; num < 5; num++)
{
cout << "Enter the name for football team # " << (num + 1) << ": \n";
cin >> FBTeam;
FBTEAM.push_back(FBTeam);
cout << "Enter the cost of tickts for football team # " << (num + 1) << ": \n";
cin >> Price_of_Ticket;
FBTEAM.push_back(Price_of_Ticket);
}
goto repeat;

case 3:
cout << "Cost of total Tution for the semester.\n";
for (vector<int>::size_type num = 0; num < 5; num++)
{


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);

cout << "Total Tution for college #"<<(num+1)<<" is: " << total_tuition << endl;
FBTEAM.resize(total_tuition);
total_tuition += averages[num];
averages[num] = total_tuition;

}

goto repeat;

case 4:
cout << "The tution: ";

for (int i = 0; i < College.size(); i++)
cout << "" << College.at(i);
cout << '\n';
cout << '\n';
cout << "Calculate Average Tuition of the five Universities: \n";
average = total_tuition / size;
cout << "The average is " << average << endl;

goto repeat;

case 5:
cout << "Search and Display ";
cout << "Please type in the item you are looking for: ";
cin >> itemNumber;

itemFound = false;
for (vector<string>::size_type i = 0; i < CULIST.size(); i++)
{
cout << CULIST[i] << " ";
}

for (vector<int>::size_type i = 0; i < FBTEAM.size(); i++)
{
cout << FBTEAM[i] << " ";
}

 

goto repeat;
case 6:
exit(0);

default:
cout << "Invalid choice.";
}
}
return 0;
}

styles Eding
%3D
AutoSave O Off
brain... -
Reyes, Felice
RF
b b x
b BGGHGEE O0 G
+
File
Home Insert Design Layout References Mailings Review View Help Acrobat
O Search
i bartleby.com/dashboard/my-questions
A
I Apps
E 10 Tips For Success...
B Lottery Number Ge..
Bb Blackboard Learn
E Reading list
>>
Paste
Font
Paragraph
Create and Share Request
Sensitivity
Editor
= bartleb
ert
Adobe PDF
Signatures
Ask a Question
Clipboard a
Adobe Acrobat
Sensitivity
Editor
Create a C++ menu program that uses two vectors to allow a user to
maintain a list of business and their teams
25 out of 30 questions left this cycle
Hi Felic
Renews on Jul 28, 2021
Ask our subject matter experts your homework question and you'll be notified
The program must have the following:
when it's answered.
Use a vector called vector1 for the college/university and a vector called Vector1
My Solutions
Answers from an expert in as fast as 30 minutes!*
for the football team
Organize the main program to call four functions.
The first function must allow a user to Add five businesses and their city
Question Asking Tips
- Ask one academic question at a time
- Keep questions specific and include all details
- Contact Support for textbook, writing, or account help
where the institution is located into the vector1 vector
A second function call the vector1 vector that must contain
Filter =
My
a. The name of the team.
b. A price of a ticket to attend.
c. The calculation of the business to use. The business should be based
on appetizer, meal, and dessert.
Subject
Computer Science
The third function should allow a user to search and display the information
such as the business, location, total, team and ticket price when searching for
the business in the vectors.
Rejected abe
2,107/5,000
Tam trying
and city)
cost and n
В
'ט
x?
X2
Ix
The fourth function must compute the average of the all the businesses and
display the result.
you can guide me how to do that.
the averas
My main concern is to ask certain questions when the user
Example: Restaurant 1 was $100
make a choice and the best function to implement into this
Restaurant 2 was $150
Engineerir
situation and how to combine a an if statement to ask the
question five times and add them to the vectors. Also, search
and display the vectors is what I need help with. Again, Please
don't reject.
Restaurant 3 was 60
Restaurant 4 was 120
Answered 1
Restaurant 5 was 200
Tam tryin
and city) a
cost and n
Then, the average cost to eat at a restaurant in this area is : $
0/2 Images
Please select images of type PNG, JPG, GIF, or BMP X
the avera
Page 1 of 1
202 words
D. Focus
100%
4:28 PM
P
7/10/2021
!!
!!
Transcribed Image Text:styles Eding %3D AutoSave O Off brain... - Reyes, Felice RF b b x b BGGHGEE O0 G + File Home Insert Design Layout References Mailings Review View Help Acrobat O Search i bartleby.com/dashboard/my-questions A I Apps E 10 Tips For Success... B Lottery Number Ge.. Bb Blackboard Learn E Reading list >> Paste Font Paragraph Create and Share Request Sensitivity Editor = bartleb ert Adobe PDF Signatures Ask a Question Clipboard a Adobe Acrobat Sensitivity Editor Create a C++ menu program that uses two vectors to allow a user to maintain a list of business and their teams 25 out of 30 questions left this cycle Hi Felic Renews on Jul 28, 2021 Ask our subject matter experts your homework question and you'll be notified The program must have the following: when it's answered. Use a vector called vector1 for the college/university and a vector called Vector1 My Solutions Answers from an expert in as fast as 30 minutes!* for the football team Organize the main program to call four functions. The first function must allow a user to Add five businesses and their city Question Asking Tips - Ask one academic question at a time - Keep questions specific and include all details - Contact Support for textbook, writing, or account help where the institution is located into the vector1 vector A second function call the vector1 vector that must contain Filter = My a. The name of the team. b. A price of a ticket to attend. c. The calculation of the business to use. The business should be based on appetizer, meal, and dessert. Subject Computer Science The third function should allow a user to search and display the information such as the business, location, total, team and ticket price when searching for the business in the vectors. Rejected abe 2,107/5,000 Tam trying and city) cost and n В 'ט x? X2 Ix The fourth function must compute the average of the all the businesses and display the result. you can guide me how to do that. the averas My main concern is to ask certain questions when the user Example: Restaurant 1 was $100 make a choice and the best function to implement into this Restaurant 2 was $150 Engineerir situation and how to combine a an if statement to ask the question five times and add them to the vectors. Also, search and display the vectors is what I need help with. Again, Please don't reject. Restaurant 3 was 60 Restaurant 4 was 120 Answered 1 Restaurant 5 was 200 Tam tryin and city) a cost and n Then, the average cost to eat at a restaurant in this area is : $ 0/2 Images Please select images of type PNG, JPG, GIF, or BMP X the avera Page 1 of 1 202 words D. Focus 100% 4:28 PM P 7/10/2021 !! !!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY