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
On December 31, 2019, Irey Co. has $3,000,000 of short-term notes payable due on February 14, 2020. On February 8, 2020, Irey bo
svet-max [94.6K]

Answer:

$1,800,000

Explanation:

Given short term notes payable = $3,000,000

Total amount used to liquidate short term notes = $2,200,000

Balance = $3,000,000 - $2,200,000 = $800,000

The additional $1,200,000 which is borrowed from Country Bank will not increase the short term notes payable because it's a long term credit

The additional $1,000,000 cash used will now be added to the balance amount

Amount to be reported as current liabilities = $1,000,000 + $800,000

= $1,800,000

Therefore the amount of the short-term notes payable that should be reported as current liabilities on the December 31, 2019 balance sheet which is issued on March 5, 2020 is $1,800,000

3 0
3 years ago
Your business is launching a new product offering and plans to send an email notifying your customers of the launch. since your
aniked [119]
The simplest thing to do is to categorise your customers by their industries and send specified emails to a cluster of customers from each industry.  
4 0
2 years ago
In an activity-based costing system, what should be used to assign a department’s manufacturing overhead costs to products produ
kicyunya [14]

Answer: Multiple cause-and- effect relationship should be used

Explanation:

A multiple cause-effect relationship is a relationship in which an event (the cause) makes another event happen (the effect).

A particular cause can have several effects.

7 0
3 years ago
What type of activity is the purchase of equipment for cash?
RSB [31]
<span>Acquisition or Procurement is the means on how equipment is bought for businesses and the military. However for peoples own personal use, shopping is the more common everyday word.</span>
6 0
3 years ago
_____________, fill in the blank, requires that sales associates be friendly, knowledgeable, and helpful.
seraphim [82]

It should be noted that Personal selling requires that sales associates be friendly, knowledgeable, and helpful.

<h3>What is Personal selling all about?</h3>

Personal selling  can be regarded as face-to-face selling where someone  who is the salesman tries to convince the customer in buying a product.

It serves as a promotional method by which the salesperson uses his or her skills to sell goods.

Learn more about Personal selling at;

brainly.com/question/7156426

3 0
2 years ago
Other questions:
  • Derby Inc. manufactures a product which contains a small part. The company has always purchased this motor from a supplier for $
    12·1 answer
  • Generally it is thought that assignment of property rights leads to efficient use of resources. We noted two cases however (the
    5·1 answer
  • For each separate case, record an adjusting entry (if necessary). Barga Company purchases $32,000 of equipment on January 1. The
    7·1 answer
  • Which of the following payments types require you to pay upfront
    11·1 answer
  • Which of the following tasks is likely to be done by the HR department?
    8·2 answers
  • On January 1, a company issues bonds dated January 1 with a par value of $290,000. The bonds mature in 5 years. The contract rat
    6·1 answer
  • Does anyone know what this answer is?
    13·2 answers
  • An investor believes that the U.S. dollar will rise in value relative to the Japanese yen. The same investor is considering two
    5·1 answer
  • Help please Briefly explain how technology affects promotional strategies.
    14·1 answer
  • Explain the importance of understanding how teams work together to achieve the same goal​
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!