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
kolbaska11 [484]
3 years ago
13

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 array and the ratings in another int array. Output these arrays (i.e., output the roster).

Ex:Enter player 1's jersey number: 84Enter player 1's rating: 7Enter player 2's jersey number: 23Enter player 2's rating: 4Enter player 3's jersey number: 4Enter player 3's rating: 5Enter player 4's jersey number: 30Enter player 4's rating: 2Enter player 5's jersey number: 66Enter player 5's rating: 9ROSTERPlayer 1 -- Jersey number: 84, Rating: 7Player 2 -- Jersey number: 23, Rating: 4...
Engineering
1 answer:
Flauer [41]3 years ago
4 0

Answer:

#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;

       }

   }

}

Explanation:

You might be interested in
An airliner is flying at 34,000 ft cruise altitude on a standard day. Calculate the pressure difference between the cabin and th
nadya68 [22]

Answer:

\Delta P=61,952.8\ lb/ft^2

Explanation:

Given

Airline flying at 34,000 ft.

Cabin pressurized to an altitude 8,000 ft.

We know that at standard condition ,density of air

\rho =0.074\ lb/ft^3

We know that pressure difference    

ΔP=ρ g ΔZ

Here ΔZ=34,000-8,000  ft

        ΔZ=26,000 ft

g= 32.2\ ft/s^2

ΔP=0.074 x 32.2 x 26,000

\Delta P=61,952.8\ lb/ft^2

So pressure difference will be \Delta P=61,952.8\ lb/ft^2.

7 0
4 years ago
Advantage of a sheave wheel in a shaft headgear<br>​
NikAS [45]

Answer:

sorry if wrong

Explanation:

One sheave means that you are using a single drum winder. They are the worst! Double drum winders control easier, brake better and are much more efficient. They save time ( two skips or cages) and can be clutched to perform faster shift transport. A single drum is slow, unbalanced and can be a nightmare if it trips out during hoisting. If the brake system is not perfect it can be a real hairy experience. For a runaway single drum, there is no counterbalance effect. It always runs to destruction. With a double drum, the driver still has a chance to control the winder to a certain extent and he has two sets of brakes to rely on. A single sheave could also mean a shaft with a single compartment. No second means of escape unless there are ladders or stairways. Not a very healthy situation.

Those are just a few points. I am sure much more can be said in favor of a double drum winder and two or more sheaves in the headgear. Most of the shafts I have worked at have multiple winders and up to ten compartments. They all have a small single drum service winder for emergencies and moves of personnel during shift times. They are referred to as the Mary - Annes. Apparently, the name originated in the U.K. where an aristocratic mine owner named the first such winder after his mistress.

5 0
3 years ago
Explain combined normal and shear stresses with sketch. Write the general expression for (a) Normal and shear stresses on inclin
Alborosie

Answer:

a) Normal stress :

бn =[ ( бx + бy ) / 2  + ( бx - бy ) / 2  ] cos2∅ + Txysin2∅

shear stress

Tn = ( - бx - бy ) / 2  sin2∅ + Txy cos2∅

b) principal stress :

б1 = ( бx + бy ) / 2  - \sqrt{}( ( бx - бy ) / 2 )^2 + T^2xy

maximum shear stress:

Tmax  = ( б1 - б2) / 2 = √ (( бx - бy ) / 2 )^2 + T^2xy

Explanation:

Combined normal stress and shear stress  sketches attached below

The terms in the sketch are :

бx = tensile stress in x direction

бy =  tensile stress in y direction

Txy = y component of shear stress acting on the perpendicular plane to x axis

бn = Normal stress acting on the inclined plane EF

Tn = shear stress acting on the inclined plane EF

A) Normal and shear stresses on inclined plane

Normal stress :

бn =[ ( бx + бy ) / 2  + ( бx - бy ) / 2  ] cos2∅ + Txysin2∅

shear stress

Tn = ( - бx - бy ) / 2  sin2∅ + Txy cos2∅

B) principal and maximum shear stresses

principal stress :

б1 = ( бx + бy ) / 2  - \sqrt{}( ( бx - бy ) / 2 )^2 + T^2xy

maximum shear stress:

Tmax  = ( б1 - б2) / 2 = √ (( бx - бy ) / 2 )^2 + T^2xy

6 0
3 years ago
Conductivity is the reciprocal of what?
iogann1982 [59]

Answer:

Electrical conductivity or specific conductance is the reciprocal of electrical resistivity. It represents a material's ability to conduct electric current. It is commonly signified by the Greek letter σ (sigma), but κ (kappa) (especially in electrical engineering) and γ (gamma) are sometimes used.

                   

3 0
3 years ago
Read 2 more answers
We have a parallel-plate capacitor, with each plate having a width W and a length L. The plates are separated by air with a dist
Vesnalui [34]

Answer:

k

Explanation:

8 0
3 years ago
Other questions:
  • 5b. The object George is examining has a mass of 15 grams. What is<br> the density of the object?
    5·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • What Happens If A Sonic Boom Is Created?
    8·1 answer
  • 3. Technician A says passive permanent
    5·1 answer
  • __________<br> is an accurate way of drawing that shows an object's<br> true size and shape.
    7·1 answer
  • Principals of Construction intro
    11·1 answer
  • An electrical current of 700 A flows through a stainlesssteel cable having a diameter of 5 mm and an electricalresistance of 610
    15·1 answer
  • What is a splitter gearbox​
    15·1 answer
  • What type of spring is mounted on a mcpherson strut suspension system?
    13·1 answer
  • At the beginning of last year, tarind corporation budgeted $1,000,000 of fixed manufacturing overhead and chose a denominator le
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!