answer.
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]
1 year 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]1 year 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
Solar Innovations Corporation bought a machine at the beginning of the year at a cost of $42,000. The estimated useful life was
inysia [295]

Answer:

<u>Depreciation schedule for :</u>

                  Straight-line    Units-of-production    Double-declining-balance

Year 1              $ 7,400                  $8,325                            $16,800

Year 2             $ 7,400                  $10,175                            $10,080

Year 3             $ 7,400                  $8,325                              $6,048

Year 4             $ 7,400                  $8,325                              $3,629

Year 5             $ 7,400                  $1,850                                $2,177

Straight Line Method will result in the highest Net Income. This is because it provides for the lowest charge of depreciation expense

Explanation:

Straight-line

Straight line method charges the same amount of depreciation (fixed  on cost) over the useful life of an asset.

Depreciation Charge = (Cost - Residual Value) ÷ Estimated Useful Life

                                   = ($42,000 - $5,000) ÷ 5

                                   = $ 7,400

<u>Annual Straight line Depreciation Charge</u>

Year 1  = $ 7,400

Year 2 = $ 7,400

Year 3 = $ 7,400

Year 4 = $ 7,400

Year 5 = $ 7,400

Units of Production

Depreciation Charge = (Cost - Residual Value) / Total Expected Production × Period`s Production

Therefore,

Depreciation Charge = Rate of depreciation × Period`s Production

then,

Rate of depreciation = ($42,000 - $5,000) / 20,000 units

                                   = $1.85 per unit of production

<u>Annual Units of Production Deprecation Charge</u>

Year 1  = 4,500 units × $1.85 = $8,325

Year 2 = 5,500 units × $1.85 = $10,175

Year 3 = 4,500 units × $1.85 = $8,325

Year 4 = 4,500 units × $1.85 = $8,325

Year 5 = 1,000 units × $1.85 = $1,850

Double-declining-balance.

Depreciation Expense = 2 × SLDP × BVSLDP

Where,

SLDP = 100 ÷ Number of useful life

         = 100 ÷ 5

         =  20 %

<u>Annual Double-declining-balance Expense</u>

Year 1 = 2 × 20% × $42,000

          = $16,800

Year 2 = 2 × 20% × ($42,000 - $16,800)

           = $10,080

Year 3 = 2 × 20% × ($42,000 - $16,800 - $10,080)

           = $6,048

Year 4 = 2 × 20% × ($42,000 - $16,800 - $10,080 - $6,048)

           = $3,629

Year 5 = 2 × 20% × ($42,000 - $16,800 - $10,080 - $6,048- $3,629)

           = $2,177

3 0
2 years ago
Woodcarving Co. incurred the following costs during May: Conversion costs $ 476,500 Prime costs 403,750 Manufacturing overhead 3
faust18 [17]

Answer:

The correct answer is C

Explanation:

With the following information, we need to calculate the direct materials and direct labor:

Woodcarving Co. incurred the following costs during May:

Conversion costs $ 476,500

Prime costs 403,750

Manufacturing overhead 320,500

We know that:

Conversion cost= direct labor + Manufacturing overhead

476500= direct labor + 320500

direct labor= $156000

Prime costs= direct materials + direct labor

403750= direct materials + 156000

direct labor= $247750

7 0
2 years ago
The following are data for an economy in billions of dollars: Net rental income 141 Depreciation 1,241 Compensation of employees
Brilliant_brown [7]

Answer:

GDP= 9,872

Explanation:

The Expenditure Approach is a method of measuring GDP by calculating all spending throughout the economy including consumer consumption, investing, government spending, and net exports. This method calculates what a country produces, assuming that the finished goods and services of a country equals the amount spent in the country for that period.

The formula is:

GDP=C+I+G+/-NX

GDP: Gross Domestic Product

(C) consumer spending – this is the amount that all consumers spend on goods and services for personal use.

(I) investment – this is the amount that businesses or owners spend to invest in new equipment or expansions.

(G) government spending – this includes spending on new infrastructure like bridges and roads.

(NX) net exports – this includes spending on a country’s exports minus its spending on imports.

GDP= 6,728+1,767 +1,741+(1,102-1,466)

GDP= 9,872

7 0
2 years ago
A stadium has two sponsorship deals. Deal A has revenue of $100,000 and expenses of $10,000. Deal B has revenue of $50,000 and e
vladimir2022 [97]

Profit can be found by subtracting revenue from expenses.

The profit for Deal A is $100,000 - $10,000 = $90,000

The average profit as a percentage of revenue for the stadium for Deal A is Average profit divided by revenue multiplied by 100. That is 90,000/100,000 x 100 is 90%

The profit for Deal B is $50,000 - $20,000 = $30,000

The average profit as a percentage of revenue for the stadium for Deal B is Average profit divided by revenue multiplied by 100. That is 30,000/50,000 x 100 is 60%

8 0
2 years ago
Read 2 more answers
Jim debt was reviewing the total accounts receivable. this month he received $80,000 from credit customers. this represented 40%
Eduardwww [97]
200,000 have to find what 10 percent is and multiply that by 10
4 0
1 year ago
Read 2 more answers
Other questions:
  • In its first month of operations, Bethke Company made three purchases of merchandise in the following sequence: (1) 300 units at
    6·1 answer
  • Johnson Production Company paid a dividend yesterday of $3.50 per share. The dividend is expected to grow at a constant rate of
    10·1 answer
  • Prior to liquidating their partnership, Joyce and Xi had capital accounts of $50,000 and $105,000, respectively. Prior to liquid
    7·1 answer
  • Researchers usually start their investigation by examining some of the rich variety of low-cost and readily available ________ d
    6·1 answer
  • Choose all that apply.
    10·1 answer
  • A U.S. firm has sold an Italian firm €1,000,000 worth of product. In one year the U.S. firm gets paid. To hedge, the U.S. firm b
    14·2 answers
  • Product X-547 is one of the joint products in a joint manufacturing process. Management is considering whether to sell X-547 at
    13·1 answer
  • Cahalane Corporation has provided the following data for its two most recent years of operation: Selling price per unit $ 91 Man
    14·1 answer
  • The Fime Corporation uses a standard costing system. The following data have been assembled for December: Actual direct labor-ho
    6·2 answers
  • You have 21 product displays. Six have 5 shelves and 15 have 4 shelves. It is store policy to dedicate at least one full shelf t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!