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
Mango Company applies overhead based on direct labor costs. For the current year, Mango Company estimated total overhead costs t
Masteriza [31]

Answer:

55,000 Credit balance

Explanation:

Mango Company

Predetermined overhead rate /Estimated overhead cost

= $600,000 / $300,000

Estimated direct labor cost = 200%

Applied overhead :

=Actual direct labor cost of $335,000 × 200%

= $670,000

Overhead incurred-Overhead applied

$615000 – $670,000

=$55,000

Therefore At year-end, the balance in the Factory Overhead account is a: credit of $55,000

8 0
3 years ago
Read 2 more answers
Mistor Co. amended its pension plan on January 2 of the current year. It also granted $600,000 of unrecognized prior service cos
vesna_86 [32]

Answer: $105,000

Explanation:

Given, unrecognized prior service costs granted = $600,000

service years in future = 2,000

service years this year = 350

Mistor's unrecognized prior service cost amortization for the year = (unrecognized prior service costs granted) ÷ (service years in future) ×(service years this year )

= $(600000÷2000×350)

= $105,000

Hence, Mistor's unrecognized prior service cost amortization for the year = $105,000

6 0
3 years ago
Park Co is considering an investment that requires immediate payment of $28.245 and provides expected cash inflows of 59,300 ann
statuscvo [17]

Answer:

The net present value of this investment is $3,256.06.

Explanation:

Note: There two errors in the figures provided in this question. They are they therefore fixed before answering this question as follows:

Park Co is considering an investment that requires immediate payment of $28,245 and provides expected cash inflows of $9,300 annually for four years. Assume Park Co requires a 7% return on its investments.

What is the net present value of this investment?

The explanation of the answer is now provided as follows:

The present value (PV) of the annual expected cash inflows of $9,300 can be calculated using the formula for calculating the present value of an ordinary annuity as follows:

PV of the annual expected cash inflows = Annual expected cash inflows * ((1 - (1 / (1 + rate of returns))^number of years) / rate of returns) = $9,300 * ((1 - (1 / (1 + 0.07))^4) / 0.07) = $31,501.06

Net present value = PV of the annual expected cash inflows – Required immediate payment for the investment = $31,501.06 - $28,245 = $3,256.06

Therefore, the net present value of this investment is $3,256.06.

6 0
3 years ago
Consider three investment plans at an annual rate of 9.38%.
PolarNik [594]

Answer:

Investor A = $545216 .

Investor B = $352377

Investor C = $897594

Explanation:

Annual rate ( r )  = 9.38%

N = 41 years

<u> Calculate the balance at age of 65</u>

1) For Investor A

balance at the end of 10 years

= $2000 (FIA, 9.38 %, 10) (1 + 0.0938) ≈ $33845

Hence at the end of 65 years ( balance )

= $33845 (FIP, 9.38 %, 31) ≈ $545216 .

2) For investor B

 at the age of 65 years ( balance )

= $2000 (FIP, 9.38%, 31) = $322159 x (1 + 0.0938) ≈ $352377

3) For Investor C

at the age of 65 years ( balance )

= $2000 (FIP, 9.38%, 41) = $820620 x (1 + 0.0938) ≈ $897594

7 0
3 years ago
To develop an effective control system, it must be related to the organizational strategy. Yes or no.
Georgia [21]

Answer:

yes

Explanation:

because in order for everything to be organized you need to know how the system is running

8 0
3 years ago
Other questions:
  • The Internet raises the bargaining power of customers by: A. reating new opportunities for building loyal customer bases. B. mak
    8·1 answer
  • If ZipCar engaged in all the activities discussed in the video, but then sold customer data to a third party in a contradiction
    9·1 answer
  • Fortune Company's direct materials budget shows the following cost of materials to be purchased for the coming three months: Jan
    6·1 answer
  • Barr Corp. started a long-term construction project in 20X0. The following data relate to this project: Contract price $4,200,00
    9·1 answer
  • Ann needs to share information about a new hiring policy. She needs to communicate this information to more than one hundred emp
    12·1 answer
  • A business charging too little for its product runs the risk of
    11·1 answer
  • Fiji, Inc. started 2025 with $12,000 in assets and $2,500 in liabilities. Fiji had issued 50 shares of stock when it went into b
    7·1 answer
  • 1. Most financial crises in the United States have begun with A. a steep stock market decline. B. an increase in uncertainty res
    7·1 answer
  • 100 Points!! PLS HELP ASAP!! In a short response of approximately 75 words, explain what type of company would elect to develop
    6·2 answers
  • From the consumer’s perspective, the elements of an imc strategy can be viewed as being either.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!