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
A what is marked by two sets of double yellow lines with each set having a broken line on the inside and a solid line on the out
yKpoI14uk [10]

Answer:

(C) Center left turn lanes!

Explanation:

I'm positive this answer is correct! :)

Have a nice day!

5 0
3 years ago
Cellular network towers are configured in such a way so that they avoid what type of problem?
stiv31 [10]
Avoiding OVERLAP issues
6 0
3 years ago
Read 2 more answers
What’s a trade off? What is one trade-off that the New Balance management makes?
zhannawk [14.2K]

Answer:

A trade-off is a decision to give up one quality to gain another quality. New Balance never lays off employees, but it costs.

Explanation:

8 0
3 years ago
What does self-consolidating concrete not need?
Klio2033 [76]

Answer:

Self-consolidating concrete does not need: Vibrating Given a proper gradation of satisfactory aggregates, the strength of cured concrete is primarily dependent on the amount of cement in the mix and on the water-cement (w-c or W/C) ratio. The higher the water-cement ratio the higher concrete strength. False

6 0
3 years ago
In terms of the total cost ("levelized cost") per kiloWatt-hour, which of the following is the cheapest way to provide electrica
SOVA2 [1]

Answer:

Solar panels has least total cost per kilo watt-hour

Explanation:

Step1

All the given energy source is the Renewable energy source. So, the entire energy source will not diminish with time. Levelized energy cost or levelized cost is the method of comparing energy sources on the basis of cost per unit energy produced over time limit. It is the ratio of average cost to power output over large time duration.

Step2

Wind power is the source of energy which gives energy by using kinetic energy of the air. This energy source has less operating cost but high maintenance and initial cost. Also this source of energy is capable to produce large amount of energy.

Step3

Geothermal power has high initial, maintenance cost and operating cost. Less amount of energy is produced through geothermal power plant.

Step4

Solar panels on the roofs of houses has less initial and maintenance cost as well as it produces energy in less area as compare to other sources of energies. So, this source of energy has least total cost per kilo watt-hour.

Step5

Nuclear power source has high initial, maintenance and working cost. It produces large amount of energy but it has high total cost of energy production.  

7 0
3 years ago
Other questions:
  • A bridge hand consists of 13 cards. One way to evaluate a hand is to calculate the total high point count (HPC) where an ace is
    7·1 answer
  • Using Python, have your program do the following, using loops (no recursion)
    5·1 answer
  • During an expansion process, the pressure of a gas changes from 15 to 140 psia according to the relation P = aV + b, where a = 5
    12·1 answer
  • Consider three charged sheets, A, B, and C. The sheets are parallel with A above B above C. On each sheet there is surface charg
    7·1 answer
  • A power plant operates on a regenerative vapor power cycle with one open feedwater heater. Steam enters the first turbine stage
    11·1 answer
  • An isentropic steam turbine processes 2 kg/s of steam at 3 MPa, which is exhausted at50 kPa and 100C. Five percent of this flow
    12·1 answer
  • What are materials engineers trying to discover when they study different materials?
    15·2 answers
  • Applications of fleming hand rule
    6·1 answer
  • You have discovered an element that is a poor conductor of electricity, has a low melting point, and is a gas at room temperatur
    6·1 answer
  • What Advantage does a voltmeter have over a noncontact voltage indicator when testing for voltage
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!