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
Inga [223]
2 years ago
5

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 jer

sey numbers in one int array and the ratings in another int array. Output these arrays (i.e., output the roster). (3 pts)
Ex:

Enter player 1's jersey number: 84
Enter player 1's rating: 7

Enter player 2's jersey number: 23
Enter player 2's rating: 4

Enter player 3's jersey number: 4
Enter player 3's rating: 5

Enter player 4's jersey number: 30
Enter player 4's rating: 2

Enter player 5's jersey number: 66
Enter player 5's rating: 9


ROSTER
Player 1 -- Jersey number: 84, Rating: 7
Player 2 -- Jersey number: 23, Rating: 4
...
Computers and Technology
1 answer:
tiny-mole [99]2 years ago
3 0

Answer:

  1. import java.util.Scanner;
  2. public class Main {
  3.    public static void main (String [] args) {
  4.        int jersey_num [] = new int[5];
  5.        int rating [] = new int[5];
  6.        Scanner inStream = new Scanner(System.in);
  7.        for(int i=0; i < 5; i++){
  8.            System.out.print("Enter player " + (i+1) + "'s jersey number:");
  9.            jersey_num[i] = inStream.nextInt();
  10.            System.out.print("Enter player " + (i+1) + "'s rating:");
  11.            rating[i] = inStream.nextInt();
  12.        }
  13.        System.out.println("ROSTER");
  14.        for(int j=0; j < 5; j++){
  15.            System.out.println("Player " + (j+1) + "-- Jersey number: " + jersey_num[j] + ", Rating: " + rating[j]);
  16.        }
  17.    }
  18. }

Explanation:

The solution code is written in Java. Firstly create two array, jersey_num and rating, with int type. This is to hold the five pairs of numbers input by user (Line 6 -7).

Next, create a for loop that run for 5 iterations and in each iteration prompt user to input jersey number and rating (Line 11 -17). The input number and rating will be set to the array, jersey_num and rating, respectively.

Next, print the title "Roster" (Line 19).

Create another for loop to display the five input pair of values (Line 21 - 23).

You might be interested in
Earning wise scope of web and mobile app development
lubasha [3.4K]

Answer:

Mobile are build in a specific platform such as Android, iOS ect and they use application such as apple store and have access to the system such as GPS and the camera. Mobile apps live and run on mobiles as on they are their own thing controlled by a developer on the other end

Explanation:

3 0
3 years ago
Which electrical protective device is designed. To detect a difference in current between circuits wires and interrupt the circu
Rudik [331]
 Circuit breaker beacuse it cuts everything off
7 0
2 years ago
Jqiom:FNU Ojlak toiha 438oy9ctu4jmpvke,u9wjm8i
Mazyrski [523]

Answer:

dfghgfdfghgfdfghgfdfghjhgfdfghjhgfdfghjhgfghjhgferghjhre

Explanation:

3 0
3 years ago
Jeremie ran around the track at the YMCA for 2 hours.
tekilochka [14]
What's the question your asking here cause I'd be happy to answer it.
4 0
3 years ago
Data is communicated through various input devices true or false​
kipiarov [429]
I would believe this is true if the following are also true.

Input devices are things like keyboards, mouses, buttons, e.c.t.

If that is true then I would believe it to be true due to multiple inputs are being used to communicate.
3 0
3 years ago
Other questions:
  • How to you put a color into a cell? <br> a.Shading<br><br> b.Fill<br><br> c.Color<br><br> d.Insert
    8·1 answer
  • In an inheritance situation, the new class that you create from an existing class is known as the:
    5·1 answer
  • What is the purpose of a mail merge field?
    9·2 answers
  • write a simple assembly code using 8088 microprocessor instruction set to add two numbers ? please help me if you know :(​
    11·1 answer
  • Where is the typical location of a touchpad inside of a laptop?
    13·1 answer
  • How can volunteering yo help plan fundraiser for your team or club be a way to develop your strengths?
    13·1 answer
  • How many sets of number do both Hex and RGB values have?
    10·1 answer
  • Fill in the blanks:<br>Can anyone help me out with this <br>​
    9·1 answer
  • This feature in Word Online allows you to view your document to see what it will look like when printed.
    6·2 answers
  • The following is a training dataset that has ten one dimensional objects.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!