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]
2 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]2 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
Assume that when the price of cantaloupes is $2.50 the demand for cantaloupes is unit-elastic, and that the demand curve for can
Maru [420]

Answer:

The correct answer is option A.

Explanation:

The demand for cantaloupes is unitary elastic at price level $2.50. The demand curve here is linear and downward sloping. The elasticity of demand is 1.

In this linear demand curve the lower portion will represent inelastic demand.

When the price level is reduced to $2 the demand will move to the lower portion of the curve, with fall in price and increase in demand.

So, at $2 price the demand will be inelastic, which means it will be between 0 and 1.

4 0
2 years ago
We are evaluating a project that costs $2,040,000, has a life of 7 years, and has no salvage value. Assume that depreciation is
OleMash [197]

Answer: best case Nvp $2,943,304,509.57

Worse case NVP

-$2, 601,609,39

3 0
2 years ago
Read 2 more answers
Kasravi Co. had net income for 2011 of $300,000. The average number of shares outstanding for the period was 200,000 shares. The
yuradex [85]

Answer:

$1.49 per share

Explanation:

The calculation of diluted earnings per share is given below:-

Diluted shares outstanding= $200,000 + 12,000 × ($36 - $30) ÷ 36

= $200,000 + 12,000 × 6 ÷ 36

= $200,000 + 2,000

= $202,000

Diluted earnings per share = Net income ÷ Diluted shares outstanding

= $300,000 ÷ $202,000

= $1.49 per share

Therefore for computing the diluted earnings per share we simply divide the net income by diluted shares outstanding.

5 0
2 years ago
One of the most important features of a filing and record keeping system is that it works for you and meets your needs
Vlad [161]

Answer:

True

Explanation:

Its key features include ;

Time saving ; it should allow faster filing and retrieval.

Cost saving- it should provide less likelihood of losing documents.

Expandability and flexibility -to meet everyone's needs in a firm; this feature makes the answer to the question true.

5 0
2 years ago
Charger Company's most recent balance sheet reports total assets of $32,868,000, total liabilities of $19,668,000 and total equi
-Dominant- [34]

Answer:

1.49

Explanation:

The computation of the debt equity ratio is shown below:

Debt Equity Ratio is

= Total liabilities ÷ total equity

= $19,668,000 ÷ $13,200,000

= 1.49

By dividing the total liabilities from the total equity we can get the debt equity ratio and the same is to be considered plus it also shows a relationship between the total liabilities and total equity

4 0
2 years ago
Other questions:
  • Campbell's soup company continues to add new food products to its product line under the campbell's brand name. this is known as
    12·1 answer
  • Match each barrier of communication to the situation with which it corresponds.
    14·1 answer
  • Nikita is the manager of a local small hotel. Just today Nikita received word that a major convention will be coming to town nex
    11·1 answer
  • Sales this year at Stars and Stripes Consignment have been high, and based on several factors, Stars and Stripes projects next y
    13·1 answer
  • An example of the __________ effect is when BMW gained in-depth information about visitors to a popular Chinese social media sit
    15·2 answers
  • John’s home is up for sale. He originally bought it five years ago for $300,000. Its current value is $350,000. His real estate
    15·1 answer
  • Lopez Corporation incurred the following costs while manufacturing its product:
    9·1 answer
  • A first-rate SWOT analysis is a way to measure whether a company's value chain is longer or shorter than the chains of key rival
    10·1 answer
  • Jolene has always wanted to work in Physical Therapy. Which career would be the best choice if she wants to get into a job that
    13·2 answers
  • You are evaluating a potential investment in equipment. The equipment's basic price is $176,000, and shipping costs will be $3,5
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!