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]
2 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]2 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 do you hope to gain from the course of economic development?​
Slav-nsk [51]

Explanation:

An economics degree gives you a high level of mathematical and statistical skills and the ability to apply economic principles and models to problems in business, finance and the public sector. ... numeracy - handling complex data and techniques of mathematical and statistical analysis. problem-solving. analytical skills

8 0
2 years ago
Should underperforming restaurants be closed or sold?
crimeas [40]

Answer:

sold

Explanation:

Underperforming restaurants are those restaurants  which does not perform well. The restaurant does not run properly and no people or less people visits the restaurant for eating.

This can be due to several factors. The restaurant's location may not be good, the restaurant may not provide good quality and tasty food, or people might not find their required menu in that restaurant. All these factors leads to less people visiting the restaurant and less revenue generation.

In such a case, the owner of the restaurant must sell the restaurant to some other party so that he does not undergo any losses. By selling the property he will get some amount of his investment which he could utilize in his further projects.

Also by selling the restaurant, the employees of that restaurant will not go out of job and can feed their family.

So, the restaurant should be sold.

7 0
3 years ago
discuss how Continuous Improvement is impacting healthcare, banking, retail and/or government (choose one area). Merger of Lean
kozerog [31]

Answer:

Explanation:

<u>How Continuous Improvement is impacting Healthcare</u>

1. There is now a greater availability of consultancy services

2. Community health awareness programs are instilling health consciousness and care in members of remote communities

3. The presence of NGOs (Non-governmental Organizations) and NPOs (Non-profit Organizations) is increasing the availability of free medicines, equipment and healthcare infrastructure in low-income countries or states

4. Technological revolution has affected the health sector as well. Medical services and interactions between patients and doctors, has gone digital. Software applications were doctors and patients can meet, are now in vogue. This has reduced the stress, costs and risks involved in migrating from one place to another to deliver or receive healthcare. It also helps proffer immediate (temporary or permanent) solutions to emergency cases.

5. Apart from making good use of technology and philanthropy, regular scientific research impacts healthcare positively; by serving better ways to treat certain ailments and searching out the cures to new ailments or pandemics.

4 0
3 years ago
The Constitution expressly grants which of the following powers to Congress? a. to receive ambassadors b. to appoint judges c. t
lbvjy [14]

Answer:

d. to regulate interstate commerce

Explanation:

The United States Constitution has the commerce clause in Article 1 Section 8 which allows the Congress to control the commerce with other nations and among the states.

According to this clause, the Congress can regulate the commerce that takes place between states and because of that, the answer is that the  Constitution expressly grants the power to regulate interstate commerce to Congress.

3 0
3 years ago
A registered representative says in a conversation with a prospect that a certain mutual fund "has no initial sales load." The f
slava [35]

Answer:

C. The RR must explain the contingent deferred sales load to the prospect

Explanation:

7 0
2 years ago
Other questions:
  • During the last few decades in the United States, health officials have argued that eating too much beef might be harmful to hum
    7·1 answer
  • Which of the following most accurately explains why fiat money has value ?
    12·1 answer
  • If a firm invests in continuous innovation and willingly cannibalizes its existing products with more advanced products, the fir
    9·1 answer
  • When writing routine requests, you should expect strong resistance from message recipients?
    14·1 answer
  • First National Bank charges 13.7 percent compounded monthly on its business loans. First United Bank charges 14 percent compound
    7·1 answer
  • Assume you invest money in a bond that will pay you $250,000 in four years. the bond has an annual interest rate of 5%. you do n
    5·1 answer
  • In specialized fields, technical knowledge is more important to employers than communication skills when deciding whom to hire a
    6·1 answer
  • You will require $620 in 5 years. If you earn 5% interest on your funds, how much will you need to invest today in order to reac
    7·1 answer
  • You all are talking about kidz bop they are actually remixing music so family and kids younger and listen to them but you are ju
    12·2 answers
  • Assuming that all entries have been posted, prepare correcting entries for each of the following errors.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!