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
Minimizing Inventory. An electronics store sells 100 digital storage devices per year. It costs $18 to store one storage device
jarptica [38.1K]

Answer:

Expl one year. To reorder, there is a fixed cost of $36, plus $11 for each storage device.anaMinimizing Inventory. An electronics store sells 100 digital storage devices per year. It costs $18 to store one storage device for one year. To reorder, there is a fixed cost of $36,tion:

4 0
3 years ago
The employees at Violet Inc. are required to complete their work and leave the office premises by 6:00 p.m. Team outings are org
earnstyle [38]

Answer: Norms

Explanation:

According to the given scenario, the violet Inc are basically organized the team outing every month for their employees and the company are expected from every employee to be present in the outing.

The given scenario is basically exemplifies the norms as it refers to the attitude and also the behavior. The norms is one of the social values that helps for developing the personality and the human behavior.

Norms is basically defined the standards or the rules for the human on the basis of their attitude and behavior.        

  Therefore, Norms is the correct answer.

4 0
3 years ago
Privacy protection in the united states is ________ in europe.
Rus_ich [418]
<span>Privacy protection in the United states is much less stringent than in Europe.

Stringent is another word for strict. European privacy protection laws are much more strict than those in the United States. Privacy protection refers to the means of protecting your privacy and companies are not allowed to give out personal </span>information without confirmation they are allowed to do so. 
7 0
3 years ago
What will affect the amount of net pay you earn on your paycheck
photoshop1234 [79]
How much taxes they take off
8 0
3 years ago
Distinguish between limited and unlimited liability
ehidna [41]

This relates to liability of business owners. When a company has unlimited liability and starts losing money, the owners can be personally liable for losses meaning their home and personal assets could be lost. Limited liability means they can only lose the amount that they invested in the company and none of their personal assets.

5 0
3 years ago
Other questions:
  • The expense recognition (matching) principle, as applied to bad debts, requires: Multiple Choice That bad debts not be written o
    15·2 answers
  • Which type of loan requires that you pay the interest accumulated during college?
    7·2 answers
  • Select the correct answer. What is the consumer's ability and desire to buy goods and services called? A. supply B. demand C. eq
    9·1 answer
  • Daley Company prepared the following aging of receivables analysis at December 31. Days Past Due Total 0 1 to 30 31 to 60 61 to
    8·1 answer
  • The following situations should be considered independently. (FV of $1, PV of $1, FVA of $1, PVA of $1, FVAD of $1 and PVAD of $
    9·1 answer
  • Please calculate the answer to the following problem, showing all of your work. NO CREDIT will be given if I cannot follow your
    10·1 answer
  • In a one-tailed test, the rejection region is located under one tail (left or right) of the corresponding probability distributi
    8·1 answer
  • Is considered to be the shortest path to failure in business.
    7·2 answers
  • What are some possible explanations for why these loans are popular despite the fact that they create a cycle of debt for many b
    14·2 answers
  • McDonald's is a major company in the restaurant business
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!