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]
3 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]3 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
A petrol (gas) station is to be set up for fully automated operation. A driver inputs his or her credit card into the pump, the
malfutka [58]

Answer:

Explanation:

Gas Filling Station has pumps. Pumps have credit card readers. Driver can able to swipe their cards, pumps have Fuel. Pumps card readers communicate with Credit Company. Driver interacts with pump for fuel and credit card.

In this situation the following we need to treat as objects.

They are Pump, Card reader, Fuel tank, communication system, system controller and price table.

Design pattern for the following system is attached below

6 0
4 years ago
11. Written and artistic expressions are protected by
Lina20 [59]

Answer:

B

Explanation:

Written and artistic expressions are protected by intellectual property law.

8 0
2 years ago
Can someone help me with these questions?
REY [17]

website will be the first, hyperlink will be the second, A will be number three, and webpage will be number 4

8 0
3 years ago
Adding videos to your website can be tricky because there may be problems making sure they will play in all
Volgvan
The sentence ends with the word 'devices'
4 0
3 years ago
The average lease payment for a new vehicle is just over $450 per month for a three-year...
hichkok12 [17]

Answer:

it depends on your insurance company

Explanation:

7 0
3 years ago
Other questions:
  • The statements that a programmer writes in a high-level language are called ________.
    9·2 answers
  • Many shops are simply plugging up their drains to keep from inadvertently violating the law and creating environmental contamina
    15·1 answer
  • Zoom Vacuum, a family-owned manufacturer of high-end vacuums, has grown exponentially over the last few years. However, the comp
    11·1 answer
  • There are information that are in the web view source that may not appear on the web page such as meta name. In addition there c
    6·1 answer
  • Write a program that asks the user to enter the amount that he or she has budgeted for a month. A loop should then prompt the us
    11·1 answer
  • The method for updating the main memory as soon as a word is removed from the cache is called
    10·1 answer
  • Ex: If the input is: Pat Silly Doe the output is: Doe, P.S.
    9·1 answer
  • Having data in a column formatted differently based on value is known as
    7·1 answer
  • What are the reason of making computer virus.​
    6·2 answers
  • A _____ model is one that is automatically adjusted based on changing relationships among variables.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!