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]
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
Job 243 was recently completed. The following data have been recorded on its job cost sheet: Direct materials $ 51,870 Direct la
Virty [35]

Answer:

$19.20

Explanation:

Computation for the unit product cost that would appear on the job cost sheet for this job.

First step is to compute the Total Product cost

Job 243

Direct material $ 51,870

Direct labor (435*11) 4,785

Overhead (516*13) 6,708

Total Product cost $63,363

Now let Compute the unit product cost

Unit product cost=$63,363/3,300 units

Unit product cost =$19.20

Therefore the unit product cost that would appear on the job cost sheet for this job is $19.20

8 0
2 years ago
Below are the account balances for Cowboy Law Firm at the end of December. Accounts Balances Cash $ 4,000 Salaries expense 1,500
matrenka [14]

Explanation:

The preparation of the end December Income statement for Cowboy Law Firm is presented below:

                                          Cowboy Law Firm

                                           Income statement  

Revenue  

Service Revenue $7,900

Total revenues $7,900 (A)

Less: Expenses

Salaries expense $1,500

Utilities expense $1,000

Total expenses $2,500 (B)

Net income $5,400 (A- B)

4 0
3 years ago
In Charles Dickins' Christmas Carol which grumpy character says 'Bah Humbug'?
Sergio039 [100]
  it's Ebenezer Scrooge
5 0
3 years ago
Read 2 more answers
The primary goal of any marketing communication is to get the consumer to buy the product.
o-na [289]

The primary purpose of any marketing communication is to get the purchaser to buy the product. b) false

The final purpose of a marketing communique is to increase sales of your company's services and products. while you stay in contact with customers, deal with them as valued assets, and invite remarks, you construct the muse for worthwhile lengthy-term relationships.

Advertising is any paid shape of verbal exchange from a recognized sponsor or source that attracts interest to ideas, goods, services, or the sponsor itself- basically classified ads and advertisements (whether or not digital or print).

Marketing Communications specialists attention to their company's product or service to face out among competitors, so ability clients note them. They communicate with clients and advertise to new ones via social media and other online systems.

Learn more about marketing communication here: brainly.com/question/9696745

#SPJ4

7 0
2 years ago
Sarah's house caught on fire. Through the prompt assistance of her neighbor Odessa, the fire was quickly extinguished. In gratit
Zepler [3.9K]

Answer:

To enforce this promise we need to analyse whether there has been any agreement or contract between Sarah and Odessa and whether the same can be enforced.

Explanation:

In Sarah's case, her offer to gratuitously pay the neighbor for assisting in the house fire is not an enforceable contract. When the neighbor rushed to help in the fire, the offer to pay $1,000 had not yet been extended. When Sarah did extend the offer to pay $1,000, there was no consideration exchanged between both parties. The consideration, putting out the fire, had already occurred without the offer or acceptance of a contract.

Consider an alternate scenario. Sarah's house was on fire, and she could not wait for the fire department. She ran to her neighbor's house, begged for help, and offered $1,000 in exchange for neighbor's assistance. After hearing Sarah's plea, the neighbor agrees to assist in extinguishing the fire. This constitutes a contract; an offer, consideration, and acceptance.

3 0
3 years ago
Other questions:
  • To take advantage of an arbitrage opportunity, an investor would 1) construct a zero-investment portfolio that will yield a sure
    6·1 answer
  • LO 7.2What operating budget exists for manufacturing but not for a retail company?
    13·1 answer
  • Which is the most likely scenario in which someone would take out a short-term loan with a bank?
    6·1 answer
  • A popular sports company grants a license to people who use their logo on T-shirts and caps. They charge the company for the rig
    5·2 answers
  • The_______of the strategic sourcing process, which is sometimes kicked off in response to an entirely new need within an organiz
    10·1 answer
  • PLEASE LEAVE A COMMENT EVEN IF THERE ARE TWO ANSWERS! Hi, I am picking a name for my coffee shop, I was thinking CoffeeCake beca
    14·2 answers
  • The primary weakness of EBITminusEPS analysis is that
    11·1 answer
  • MECCS Inc. stock paid its annual dividends of $4.90 per share yesterday. The dividend is expected to decrease at a constant rate
    11·1 answer
  • You are evaluating a growing perpetuity investment from a large financial services firm. The investment promises an initial paym
    13·1 answer
  • Bill is the treasurer for a fast-growing organization whose budget has recently been growing at a rate of 10% per year. The budg
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!