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
A Company accumulates the following data concerning raw materials in making one gallon of finished product: (1) Price-net purcha
nordsb [41]

Answer:

Hence,

1. $2.5

2. 3 pounds

3. $7.5

Explanation:

1. The computation of standard direct material price per gallon is shown below:

=Price-net purchase price + freight-in + receiving and handling

= $2.20 + $0.20 +$0.10

= $2.5

Thus, the standard direct material price per gallon is $2.5

2.  The computation of standard direct material quantity per gallon is shown below:

= Quantity required material + Allowance for waste and spoilage

= 2.6 +0.4

= 3 pounds

3. The computation of total standard material cost per gallon is computed below:

= Standard direct materials price per gallon × Standard direct materials quantity per gallon

= $2.5 × 3

= $7.50

Hence,

1. $2.5

2. 3 pounds

3. $7.5

8 0
3 years ago
If the government imposes a price floor on wheat at $5 and agrees to purchase any surpluses, how much will the government be for
eimsori [14]
<span>The answer is that the government will be forced to spend $15,000,000.
government imposes a price floor on wheat at $5 
there will be a surplus of $3,000,000
</span><span>the government will be forced to spend = $5 x $3,000,000 = $15,000,000</span>
7 0
4 years ago
Francois deposits $350.00 in a savings account. The account pays an annual interest rate of 4.3%. He makes no other deposits or
neonofarm [45]

Answer:

$3.7625

Explanation:

Simple interest is calculated as

Interest = P x r x t

Where

p = principal amount.. $350

r= interest rate: 4.3% or 0.043

t= time in years: 3 months or 3/12 =0.25 years

Interest = $350 x 0.043 x 0.25

=$3.7625

4 0
3 years ago
It has been said that aggregate planning is related to personnel planning, budgeting, and market planning. Describe the nature o
vekshin1

Aggregate planning is essentially a holistic planning approach. Planners typically try to avoid focusing on a single product or service unless the organization has only one primary product or service. Instead, focus on total or aggregate capacity.

Overall planning should therefore be the basis for initial budget development and for budget changes when the conditions are right. Most aggregated planning approaches involve continuous decision variables, requiring frequent adjustments to both production and workforce settings. Despite the availability and versatility of these approaches, few significant applications have been reported.

Aggregate Planning from a Perspective Characteristics of Aggregate Planning In a broader sense of the definition, the problem of aggregation planning has the following characteristics.

Learn more about aggregate planning at

brainly.com/question/18803972

#SPJ4

7 0
2 years ago
A married couple received $10,000 of social security benefits. Calculate the taxable amount of those benefits if the couple’s pr
Akimi4 [234]
The answer to your question would be $4,500.
3 0
2 years ago
Other questions:
  • Marquette purchased 7% of RST stock for $50,000 on 1/1/21. Data regarding these securities follow: Year-end Date Market Value De
    6·1 answer
  • Mariah Dover cashed her $100 traveler's check in Riga, the capital of Latvia. At the current _____ rate, she received $61.82 in
    5·1 answer
  • A _____ organizational structure is like a managerial pyramid where the power structure of decision making and authority flows f
    10·1 answer
  • A person borrows ​$150 that he must repay in a lump sum no more than 8 years from now. The interest rate is 9.9​% annually compo
    13·1 answer
  • Haskins is an officer of a real estate development firm. Haskins purchased a piece of property in a rural area of Arizona with t
    9·1 answer
  • Labor productivity on the Cleveland Tools Inc. assembly line was 33 units per hour in 2019. In 2020, labor productivity was 35 u
    11·1 answer
  • Sandhill Co. entered into these transactions during May 2022, its first month of operations.
    10·1 answer
  • A good measure of average should be:
    11·1 answer
  • On october 4, 2020, concord company had credit sales transactions of $3300 from merchandise having cost $2600. the entries to re
    11·1 answer
  • How does the microeconomic environment affect your daily life? What can you do to live a better life after completing this cours
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!