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
andrey2020 [161]
3 years ago
10

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). (3 pts) Ex:
Engineering
1 answer:
kari74 [83]3 years ago
6 0

Answer:

Using C++ language

#include <iostream>

#include <vector>

using namespace std;

int main()

{

//definition

vector<int> jerseyNumber;

vector<int> rating;

int temp;

//loop

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
What is aviation? What is the difference between aviation and flight?
-Dominant- [34]
Aviation refers to flying using an aircraft, like an aeroplane. It also includes the activities and industries related to flight, such as air traffic control. The biggest of the many uses of aviation are in air travel and military aircraft . The main difference between aeronautics and aviation is their focus. Aeronautics involves the study of the science, design, and manufacture of flying vehicles while aviation involves flying or operating an aircraft and various activities surrounding mechanical flight and the aircraft industry
3 0
3 years ago
Need help solving math problem using integration
notka56 [123]
Ummm did you try to add or subtract and multiply or divide that can get your answer
8 0
2 years ago
When you multiply monomials with the same variables, you multiply the coefficients and add the exponents!
RideAnS [48]

Answer: ok

Explanation:

this isn't a question?

3 0
3 years ago
Where’s the silicone rubber are made ? In a machine, vulcanization… explain please !!!!! I need help
Vaselesa [24]

Answer: This is done by heating a large volume of quartz sand to temperatures as high as 1800˚C. The result is pure, isolated silicon, which is allowed to cool and then ground into a fine powder. To make silicone, this fine silicon powder is combined with methyl chloride and heated once again.

Explanation:

4 0
3 years ago
The gas expanding in the combustion space of a reciprocating engine has an initial pressure of 5 MPa and an initial temperature
Anit [1.1K]

Answer:

a). Work transfer = 527.2 kJ

b). Heat Transfer = 197.7 kJ

Explanation:

Given:

P_{1} = 5 Mpa

T_{1} = 1623°C

                       = 1896 K

V_{1} = 0.05 m^{3}

Also given \frac{V_{2}}{V_{1}} = 20

Therefore, V_{2} = 1  m^{3}

R = 0.27 kJ / kg-K

C_{V} = 0.8 kJ / kg-K

Also given : P_{1}V_{1}^{1.25}=C

   Therefore, P_{1}V_{1}^{1.25} = P_{2}V_{2}^{1.25}

                     5\times 0.05^{1.25}=P_{2}\times 1^{1.25}

                     P_{2} = 0.1182 MPa

a). Work transfer, δW = \frac{P_{1}V_{1}-P_{2}V_{2}}{n-1}

                                  \left [\frac{5\times 0.05-0.1182\times 1}{1.25-1}  \right ]\times 10^{6}

                              = 527200 J

                             = 527.200 kJ

b). From 1st law of thermodynamics,

Heat transfer, δQ = ΔU+δW

   = \frac{mR(T_{2}-T_{1})}{\gamma -1}+ \frac{P_{1}V_{1}-P_{2}V_{2}}{n-1}

  =\left [ \frac{\gamma -n}{\gamma -1} \right ]\times \delta W

  =\left [ \frac{1.4 -1.25}{1.4 -1} \right ]\times 527.200

  = 197.7 kJ

6 0
3 years ago
Other questions:
  • In a heat-treating process, a 1-kg metal part, initially at 1075 K, is quenched in a closed tank containing 100 kg of water, ini
    10·1 answer
  • A mass weighing 22 lb stretches a spring 4.5 in. The mass is also attached to a damper with Y coefficient . Determine the value
    12·1 answer
  • You will create three classes, the first two being Student and LineAtOfficeHour. The instances of the first class defines a sing
    8·1 answer
  • Consider tests of an unswept wing that spans the wind tunnel and whose airfoil section is NACA 23012. Since the wing model spans
    13·1 answer
  • This app, I'm done, bye... I can't, bye
    11·1 answer
  • Worth 20 points! Please help ASAP!
    5·1 answer
  • Why is there an Engineering Process?
    15·2 answers
  • Find the mean deviation of the set of numbers<br> (a) 12, 6, 7, 3, 15, 10, 18,5
    7·2 answers
  • Drivers education :Anything that draws your mind off driving is
    9·1 answer
  • Write down the tracking error such that the adaptive cruise control objective is satisfied.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!