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
Three possible career opportunities in embedded systems engineering
timama [110]

Answer:Embedded Software Engineer (firmware)

- System Software Engineer (kernal & RTOS)

- Application Software Engineer (device drivers)

- Software Test Engineer.

- Embedded Hardware Engineer.

- Embedded System Trainer.

- Marketing & Sales Executive.

Explanation:

3 0
3 years ago
What is the approximate Brinell hardness of a 1040 steel having a yield strength of 620 MPa (90,000 psi)
olga55 [171]

Answer:

the endurance strength   = 421.24  MPa

Explanation:

hope this helps :-)

5 0
3 years ago
A mason requires 12 mason-hours per 100 ft2 for the bottom 4 ft of wall, and a hod carrier requires 14.5 helper hours to mix the
mote1985 [20]

harden you could either me or leave

harden you could either me or leave

harden you could either me or leave

GO WATCH AFTER OUT NOW RADDED R

8 0
3 years ago
Consider steady heat transfer through the wall of a room in winter. The convection heat transfer coefficient at the outer surfac
AveGali [126]

The heat transfer which is in steady state, the heat transfer rate to the wall is equal to the wall.

<u>Explanation:</u>

  • The convection transfer of heat to the wall is

         Q=h A\left(T_{s}-T_{f}\right)

  • Here, T_{S} is the temperature of solid surface, T_{f} is the temperature of moving fluid stream which is adjacent of solid surface, h is the heat transfer coefficient.
  • The coefficient of convection heat transfers outer surface contains 3 times to the inner surface which experience smaller drop of temperature for 3 times that compares to inner surface.
  • Hence, the temperatures outer surface get close to the surroundings of air temperature.
6 0
3 years ago
Five Kilograms of continuous boron fibers are introduced in a unidirectional orientation into of an 8kg aluminum matrix. Calcula
Lunna [17]

Answer:

Explanation:

Given that,

Mass of boron fiber in unidirectional orientation

Mb = 5kg = 5000g

Mass of aluminum fiber in unidirectional orientation

Ma = 8kg = 8000g

A. Density of the composite

Applying rule of mixing

ρc = 1•ρ1 + 2•ρ2

Where

ρc = density of composite

1 = Volume fraction of Boron

ρ1 = density composite of Boron

2 = Volume fraction of Aluminum

ρ2 = density composite of Aluminum

ρ1 = 2.36 g/cm³ constant

ρ2 = 2.7 g/cm³ constant

To Calculate fractional volume of Boron

1 = Vb / ( Vb + Va)

Vb = Volume of boron

Va = Volume of aluminium

Also

To Calculate fraction volume of aluminum

2= Va / ( Vb + Va)

So, we need to get Va and Vb

From density formula

density = mass / Volume

ρ1 = Mb / Vb

Vb = Mb / ρ1

Vb = 5000 / 2.36

Vb = 2118.64 cm³

Also ρ2 = Ma / Va

Va = Ma / ρ2

Va = 8000 / 2.7

Va = 2962.96 cm³

So,

1 = Vb / ( Vb + Va)

1 = 2118.64 / ( 2118.64 + 2962.96)

1 = 0.417

Also,

2= Va / ( Vb + Va)

2 = 2962.96 / ( 2118.64 + 2962.96)

2 = 0.583

Then, we have all the data needed

ρc = 1•ρ1 + 2•ρ2

ρc = 0.417 × 2.36 + 0.583 × 2.7

ρc = 2.56 g/cm³

The density of the composite is 2.56g/cm³

B. Modulus of elasticity parallel to the fibers

Modulus of elasticity is defined at the ratio of shear stress to shear strain

The relation for modulus of elasticity is given as

Ec = = 1•Eb+ 2•Ea

Ea = Elasticity of aluminium

Eb = Elasticity of Boron

Ec = Modulus of elasticity parallel to the fiber

Where modulus of elastic of aluminum is

Ea = 69 × 10³ MPa

Modulus of elastic of boron is

Eb = 450 × 10³ Mpa

Then,

Ec = = 1•Eb+ 2•Ea

Ec = 0.417 × 450 × 10³ + 0.583 × 69 × 10³

Ec = 227.877 × 10³ MPa

Ec ≈ 228 × 10³ MPa

The Modulus of elasticity parallel to the fiber is 227.877 × 10³MPa

OR Ec = 227.877 GPa

Ec ≈ 228GPa

C. modulus of elasticity perpendicular to the fibers?

The relation of modulus of elasticity perpendicular to the fibers is

1 / Ec = 1 / Eb+ 2 / Ea

1 / Ec = 0.417 / 450 × 10³ + 0.583 / 69 × 10³

1 / Ec = 9.267 × 10^-7 + 8.449 ×10^-6

1 / Ec = 9.376 × 10^-6

Taking reciprocal

Ec = 106.66 × 10^3 Mpa

Ec ≈ 107 × 10^3 MPa

Note that the unit of Modulus has been in MPa,

7 0
3 years ago
Other questions:
  • A conducting spherical shell having an inner radius of 3 cm and outer radius of 4.3 cm carries a net charge of 9.6 μC. A conduct
    15·1 answer
  • A 3 ft x 2 ft block moves down a 15 degree inclined slope at a speed of V = 0.2 ft/s over a thin layer (h = 0.0125 ft) of oil wi
    13·1 answer
  • Modify the CountByFives application so that the user enters the value to count by. Start each new line after 10 values have been
    5·1 answer
  • A 30 mm thick AISI 1020 steel plate is sandwiched between two 10 mm thick 2024-T3 aluminum plates and compressed with a bolt and
    9·1 answer
  • A Barnes and Books is interested in purchasing a two-story building for a new
    5·1 answer
  • A 2.5 m-high, 4-m-wide, and 80-cm-thick wall of a house has a thermal resistance of 0.0125°c/W. The thermal conductivity of the
    8·1 answer
  • Before taking off a plane travels at a speed of 1/4 km per second. The runaway is 5 km. How many seconds does it take the plane
    9·1 answer
  • What is the current and power in a 120V circuit if the resistance 5Ω?
    11·2 answers
  • Define predictive analysis
    7·1 answer
  • Which of the following best describes the basic purpose of the internet?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!