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
Nature of Transactions Kristoff Walker operates his own catering service. Summary financial data for February are presented in e
vichka [17]

Answer:

A. Description for :

Transaction 1 - Provided catering service for cash

Transaction 2 - Purchase of land for cash

Transaction 3 - Payment of cash for expenses

Transaction 4 - Purchase of supplies on account

Transaction 5 - Withdrawal of cash by owner

Transaction 6 - Payment of cash to creditors

Transaction 7 - Recognition of cost of supplies used

B. The amount of the net decrease in cash during the month = 13,900

C. The amount of the net increase in owner's equity during the month = 3700

D. The amount of the net income for the month = 5500

E. The net income for the month was retained in the business = 3700

Explanation:

a)

Description for :

Transaction 1 - Provided catering service for cash

Transaction 2 - Purchase of land for cash

Transaction 3 - Payment of cash for expenses

Transaction 4 - Purchase of supplies on account

Transaction 5 - Withdrawal of cash by owner

Transaction 6 - Payment of cash to creditors

Transaction 7 - Recognition of cost of supplies used

b.)

Net decrease = Closing Balance - opening Balance

                        = 27,600 - 13,700

                        = 13,900

⇒The amount of the net decrease in cash during the month = 13,900

c.)

Net increase in owner's equity = ( Opening capital balance - Drawing + Income earned during the year - Expenses incurred during the year ) - Opening capital

⇒Net increase = ( 92,700 - 1800 + 32,300 - 26,800 ) - 92,700

                         = 96,400 - 92,700 = 3700

⇒The amount of the net increase in owner's equity during the month = 3700

d.)

Amount of the net income for the month = Total Income - Expenses

                                                                    = 32,300 - 26,800

                                                                     = 5500

⇒Amount of the net income for the month = 5500

e.)

Net income for the month was retained in the business = Net Income - Drawings

⇒Net income was retained in the business =  5500 - 1800

                                                                         = 3700

⇒Net income for the month was retained in the business = 3700

7 0
3 years ago
Whistle Stop pays a constant annual dividend of $4 on its stock. The company will maintain this dividend for the next 3 years an
Hitman42 [59]

Answer:

P0 = $9.04279 rounded off to $9.04

Option c is the correct answer

Explanation:

Using the the dividend discount model, we calculate the price of the stock today. It values the stock based on the present value of the expected future dividends from the stock. To calculate the price of the stock today, we will use the following formula,

P0 = D1 / (1+r)  +  D2 / (1+r)^2  +  D3 / (1+r)^3

Where,

  • r is the required rate of return

P0 = 4 / (1+0.156)  +  4 / (1+0.156)^2  +  4 / (1+0.156)^3

P0 = $9.04279 rounded off to $9.04

3 0
3 years ago
A checking account is sometimes called a..
asambeis [7]
B
a demand deposit lets you withdraw money without advice notice 
6 0
3 years ago
Read 2 more answers
If mara’s puzzle factory is operating at a quantity in which the marginal revenue from the last puzzle produced is $20, marginal
soldier1979 [14.2K]
The condition for a profit maximising point is where MR = MC.

When MR is greater than MC, the firm should increase production to take hold of the extra profit, therefore Mara should increase production.
7 0
3 years ago
With a​ downward-sloping demand​ curve, average revenue is equal to price A. because the firm must lower its price to sell addit
tia_tia [17]

Answer:

D. ​Actually, average revenue is always equal to​ price, whether demand is downward sloping or no

Explanation:

This is because Average revenue is the amount of revenue that is obtained by selling an addition unit of output. This additional revenue is always = Price as proven by the equation below,

Total Revenue = Price * Quantity

Thus, AR = Total Revenue / Quantity  

Input elements of the Total revenue we get,

AR = Price * Quantity / Quantity

AR = Price  

Hope that helps.

3 0
3 years ago
Other questions:
  • Eliza took her car to her regular mechanic, who had a private business. The mechanic often advertised on billboards, writing "Re
    15·2 answers
  • Use this information for Rylan Corporation to answer the question that follow. Rylan Corporation received an offer from an expor
    14·1 answer
  • In a _____ case, the defendant acknowledges that some discrimination may have occurred but argues that the same hiring decision
    12·1 answer
  • PLEAS HELP!!!!!!!! I NEED ANSWERS ASAP!!!!!​
    14·1 answer
  • Many locations require that renters be paid interest on their security deposits. If you have a security deposit of $3,600, how m
    5·1 answer
  • Company ABC has total liabilities of $660,000 and total equity of $342,000. The company needs to raise additional funds through
    10·2 answers
  • On June ​1, 2018​, High Performance Cell Phones sold $ 25 comma 000 of merchandise to Ackerman Trucking Company on account. Acke
    5·1 answer
  • Wasilko Corporation produces and sells one product. a.The budgeted selling price per unit is $114.Budgeted unit sales for Februa
    5·1 answer
  • Marginal cost is defined as:________.
    12·1 answer
  • Social media experts suggest that you use other means of communicating claims or complaints before turning to social media. Mess
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!