1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sveta [45]
3 years ago
9

This program will store roster and rating information for a soccer team. coaches rate players during tryouts to ensure a balance

d team. (1) prompt the user to input five pairs of numbers: a player's jersey number (0 - 99) and the player's rating (1 - 9). store the jersey numbers in one int vector and the ratings in another int vector. output these vectors (i.e., output the roster). (3 pts) ex:
Business
1 answer:
Vedmedyk [2.9K]3 years ago
4 0

Answer:

Explanation:

#include <iostream>

#include <vector>

using namespace std;

int main() {

   vector<int> jerseyNumber;

   vector<int> rating;

   int temp;

   for (int i = 1; i <= 5; i++) {

       cout << "Enter player " << i

            << "'s jersey number: ";

       cin >> temp;

       jerseyNumber.push_back(temp);

       cout << "Enter player " << i

            << "'s rating: ";

       cin >> temp;

       rating.push_back(temp);

       cout << endl;

   }

   cout << "ROSTER" << endl;

   for (int i = 0; i < 5; i++)

       cout << "Player " << i + 1 << " -- "

            << "Jersey number: " << jerseyNumber.at(i)

            << ", Rating: " << rating.at(i) << endl;

   char option;

   '

   while (true) {

       cout << "MENU" << endl;

       cout << "a - Add player" << endl;

       cout << "d - Remove player" << endl;

       cout << "u - Update player rating" << endl;

       cout << "r - Output players above a rating"

            << endl;

       cout << "o - Output roster" << endl;

       cout << "q - Quit" << endl << endl;

       cout << "Choose an option: ";

       cin >> option;

       switch (option) {

           case 'a':

           case 'A':

               cout << "Enter a new player's"

                    << "jersey number: ";

               cin >> temp;

               jerseyNumber.push_back(temp);

               cout << "Enter the player's rating: ";

               cin >> temp;

               rating.push_back(temp);

               break;

           case 'd':

           case 'D':

               cout << "Enter a jersey number: ";

               cin >> temp;

               int i;

               for (i = 0; i < jerseyNumber.size();

                    i++) {

                   if (jerseyNumber.at(i) == temp) {

                       jerseyNumber.erase(

                               jerseyNumber.begin() + i);

                       rating.erase(rating.begin() + i);

                       break;

                   }

               }

               break;

           case 'u':

           case 'U':

               cout << "Enter a jersey number: ";

               cin >> temp;

               for (int i = 0; i < jerseyNumber.size();

                    i++) {

                   if (jerseyNumber.at(i) == temp) {

                       cout << "Enter a new rating "

                            << "for player: ";

                       cin >> temp;

                       rating.at(i) = temp;

                       break;

                   }

               }

               break;

           case 'r':

           case 'R':

               cout << "Enter a rating: ";

               cin >> temp;

               cout << "\nABOVE " << temp << endl;

               for (int i = 0; i < jerseyNumber.size();

                    i++)

                   if (rating.at(i) > temp)

                       cout << "Player " << i + 1

                            << " -- "

                            << "Jersey number: "

                            << jerseyNumber.at(i)

                            << ", Rating: "

                            << rating.at(i) << endl;

               break;

           case 'o':

           case 'O':

               cout << "ROSTER" << endl;

               for (int i = 0; i < jerseyNumber.size();

                    i++)

                   cout << "Player " << i + 1 << " -- "

                        << "Jersey number: "

                        << jerseyNumber.at(i) << ", Rating: "

                        << rating.at(i) << endl;

               break;

           case 'q':

               return 0;

           default:

               cout << "Invalid menu option."

                    << " Try again." << endl;

       }

   }

}

You might be interested in
What situations would indicate that an increase in turnover might be just what an organization needs?
Basile [38]

Answer:

Explanation:

In the context of Human Resources, turnover refers to the number of workers who leave the organization. A scenario where an increase is what is needed the most would be if the current employees are unable to efficiently and effectively complete their work and are costing the company more money than they are producing in sales. Therefore, if those employees leave the company will save money on them and can hire newer employees that may perform much more efficiently.

7 0
3 years ago
How does implementing change affect strategic relationship management?
HACTEHA [7]

Answer:

A it upsets the balance

Explanation:

4 0
3 years ago
Read 2 more answers
​If the superior's job with a particular employee during a performance appraisal is simply to sit and listen and then have open
igor_vitrenko [27]
I’m not sure about the first one (my best guess is B.) but the second one is A.
3 0
3 years ago
If the Federal Reserve buys $8,500 worth of securities from non-bank public, and the non-bank public then keeps the payment from
vova2212 [387]

Answer:

c: C increases by $8,500 and the MB increases by $8,500

Explanation:

If the Federal Reserve buys $8,500 in securities from non-bank public and then payment is kept from the bank in form of cash, theC increases by $8,500 and the MB increases by $8,500

5 0
3 years ago
One of every nine workers belongs to a labor union in the United States today.
tino4ka555 [31]
The answer is true hope this helpsss
6 0
3 years ago
Other questions:
  • A credit card issuer charges an APR of 15.77%, and its billing cycle is 30 days long. What is its periodic interest rate?
    8·2 answers
  • Managing proactively instead of reactively is an example of which of the following
    12·2 answers
  • What is the percentage change in the multifactor labor and raw materials productivity measure for sunpath between 2011 &amp; 201
    10·1 answer
  • Craig's Car Wash Inc. is considering a project that has the following cash flow and cost of capital (r) data. What is the projec
    6·1 answer
  • Ecstasy Pharmaceuticals faces fixed costs of $1 million with manufacturing its new drug. The company sells the drug in bottles o
    14·1 answer
  • A small business has leased office space for $10,000 per year. It cannot get out of that contract. It could sublease the space t
    15·1 answer
  • You are planning a special wedding three years from today. You don't know who your spouse will be but you do know that you are s
    9·1 answer
  • Which of the following statements is true?
    5·1 answer
  • You have a $56,000 portfolio consisting of Intel, GE, and Con Edison. You put $22,400 in Intel, $14,400 in GE, and the rest in C
    8·1 answer
  • The process of achieving company goals by effective use of resources is called?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!