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
Suppose that firm a dislikes hiring black accountants, while firm b is happy to hire them. so ted ends up working at firm b rath
egoroff_w [7]
<span>Regardless of the firm, most companies will do at least a bi-annual audit if not quarterly. In this case Ted would do the same amount of audits for either company, two to four depending on the companies frequency.</span>
6 0
3 years ago
Sebastian is an employee at Plowell Inc. His duties include preparing reports and analyzing company data. He also appraises fina
Angelina_Jolie [31]

Answer:

The answer is option (D) management accountant.

Explanation:

A management accountant is an employee who prepares financial and non-financial data, verify the data, interpret information from such data and combine them (both financial and non-financial) in order present a complete picture of the business.

The results of management or managerial accounting help a company make informed business decisions that would ensure the success of the business and help sustain it.

7 0
3 years ago
By keeping employees’ personal records confidential, an employer respects their right of:
nika2105 [10]

Answer: PRIVACY. 100% postive

Explanation:

7 0
3 years ago
What does employable mean?
tester [92]

Answer:

Employable: suitable for paid work.

5 0
3 years ago
Read 2 more answers
The owner of an orange grove must decide when to pick one variety of oranges. She can sell them for $27 a bushel if she sells th
uysha [10]

Answer:

The oranges should be picked in 2 weeks for maximum return

Explanation:

We assume that the return of the owner is y ($)

Assume that the number of weeks the oranges should be picked to have maximum return is x (weeks). (x≥0)

If collect now, the price for each bushel is $27

As the price per bushel decrease by $1.50 per bushel each week

=> After x weeks, the price of a bushel decrease: 1.5x ($)

=> The price of 1 bushel after x weeks is: 27 - 1.5x ($)

If collect now, each tree can yield 7 bushels

As the yield increases by half a bushel per week for the next 5 weeks

=> After x weeks with x ≤ 5, each trees would yields: 7 + 0.5x (bushels)

The return = The price of each bushes × The quantity of bushels

=> y = (27-1.5x)(7+0.5x)

⇔y= 27 (7 +0.5x) - 1.5x(7+0.5x) = 189 + 13.5x - 10.5x - 0.75x^{2}

⇔y = -0.75x^{2} +3x +189

We have: if the equation has the form of y =ax^{2} +bx +c with a≠0, its maximum value is: max y = c - \frac{b^{2} }{4a}

In the equation y = -0.75x^{2} +3x +189, we have: a = -0.75; b = 3; c = 189

=> max y = c -\frac{b^{2} }{4a} = 189 - \frac{3^{2} }{4.(-0.75)} = 189 - \frac{9}{-3}  = 189 - (-3) = 189+3 = 192

To look for the number of weeks, we should find x (0≤x≤5) with which y = 192

192 = -0.75x^{2} +3x +189

⇔-0.75x^{2} + 3x + 189 - 192 = 0

⇔-0.75 x^{2} + 3x - 3 =0

⇔-0.75x^{2}  + 4*0.75x - 0.75*4 =0

⇔x^{2} -4x + 4 = 0

⇔ (x-2)^{2}  = 0

⇔ x = 2

The oranges should be picked in 2 weeks for maximum return

7 0
3 years ago
Other questions:
  • Wilbur decides to sell his collection of rare stamps through an online auction site. When he is filling out the information abou
    15·1 answer
  • Idle time gaming, inc., has established clear standards of performance for its latest video game that will involve physical chal
    14·1 answer
  • What annual rate of return is earned on a $1,000 investment when it grows to $2,300 in six years? (Do not round intermediate cal
    11·1 answer
  • The Donut Stop acquired equipment for $19,000. The company uses straight-line depreciation and estimates a residual value of $3,
    10·1 answer
  • A belief that something will be the case or will happen is known as:
    8·1 answer
  • Acquired $60,000 cash from the issue of common stock. Received an $8,200 cash advance for services to be provided in the future.
    15·1 answer
  • Which education and qualifications are most helpful for Revenue and Taxation careers? Check all that apply.
    13·2 answers
  • A company pays its employees $1,800 each Friday, which amounts to $360 per day for the five-day workweek that begins on Monday.
    10·1 answer
  • Suppose that XYZ Company hires labor and capital in competitive input markets. Assume that labor costs $200 per day and that a u
    9·1 answer
  • When can a bank repossess someone's car?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!