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
Consider the following class definitions: class smart class superSmart: public smart { { public: public: void print() const; voi
arsen [322]

Answer:

a) There is no any private member of smart which are public members of superSmart.

Explanation:

5 0
3 years ago
The ratio of boys to girls in the class was 2 to 3. If there were 18 girls in the class, how many students were in the class
iren2701 [21]
37 students in the class
18 Girls and 19 Boys
4 0
3 years ago
Consider the brass alloy for which the stress-strain behavior is shown in the Animated Figure 7.12. A cylindrical specimen of th
sleet_krkn [62]

Answer:

(a) 0.1509 mm

(b) 0.00525 mm

Explanation:

Stress, \sigma is given by

\sigma=\frac {F}{A} where F is force and A is area and area is given by \frac {\pi d^{2}}{4} hence

\sigma=\frac {4F}{\pi d^{2}} where d is the diameter. Substituting 9970 N for F and 10mm=0.01 m for d hence

\sigma=\frac {4*9970 N}{\pi 0.01m^{2}}=126941982.6 N/m^{2}

\sigma \approx 127 Mpa

From the attached stress-strain diagram, the stress of 127 Mpa corresponds to strain of 0.0015 and since strain is given by

\epsilon=\frac {\triangle l}{l} where\epsilon is the strain, \triangle l is elongation and l is original length and making elongation the subject

\triangle l= \epsilon \times l and substituting strain with 0.0015 and length l with 100.6 mm then

\triangle l=0.0015\times 100.6=0.1509 mm

(b)

Lateral strain is given by

\epsilon_{lat}=\frac {\triangle d}{d} and substituting -v\epsilon for \epsilon_{lat} where v is poisson ratio then

-v\epsilon=\frac {\triangle d}{d} and making \triangle d the subject then

\triangle d=-vd\epsilon and substituting 0.35 for v, 0.0015 for strain and 10 mm for d

\triangle d=-(0.35)*10*0.0015=-0.00525 mm and the negative sign indicates decrease in diameter

8 0
3 years ago
A nuclear power plant based on the Rankine cycle operates with a boiling-water reactor to develop net cycle power of 3 MW. Steam
rewona [7]

Answer:

xD

Explanation:

Nope

6 0
3 years ago
How do robots demonstrate the modern, technological Japan? *<br><br><br><br>​
Alborosie

Robots demonstrate modern, technological Japan because it serves as brought economical success to Japan since it help them to build products faster and efficiently.

  • According to the question, we are to discuss how the robot help japan in terms of technology and modernization.

As a result of this we can see that Japan is moving forward in technology with development of robot because it makes them to build more products.

Therefore, Robot has  brought economical success to Japan

Learn more about robot at:

brainly.com/question/10387419

3 0
3 years ago
Read 2 more answers
Other questions:
  • kg is moving at a speed of 40 km/h on an incline of 1 in 50. The total constant rolling and wind resistance is 600 N. The effici
    10·1 answer
  • The gradual and uniform cooling of glass that has been heated in order to relieve random internal stresses is... Group of answer
    5·1 answer
  • How to get on your screen on 2k20 in every mode
    15·2 answers
  • A flywheel made of Grade 30 cast iron (UTS = 217 MPa, UCS = 763 MPa, E = 100 GPa, density = 7100 Kg/m, Poisson's ratio = 0.26) h
    9·1 answer
  • Suppose that the following eight jobs must be scheduled through a car repair facility (repair times are shown in days): Car Repa
    13·1 answer
  • Give three examples of how engineering has made human life better in your opinion.
    13·1 answer
  • 5√1024/4√1296+3√56/3√2401-4√16/3
    6·1 answer
  • 4. Which type of duct undergoes more rigorous testing before it's labeled?
    12·1 answer
  • Bebe receives a letter from the FBI stating that she is wanted for a crime. The letter says she must send her Social Security nu
    11·1 answer
  • Which step in the engineering design process does not come before building a<br> prototype?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!