Question: Integer numScores is read from input, representing the number of integers to be read next. Then, the remaining integers are read and stored into array
Integer numScores is read from input, representing the number of integers to be read next. Then, the remaining integers are read and stored into array scoresList. For each element in scoresList that is greater than
assign the element with
Ex: If the input is:
then the output is:
Raw scores:
Adjusted scores:
import java.util.Scanner;
public class ArrayUpdate
public static void main
String
args
Scanner scnr
new Scanner
System
in
;
int
scoresList;
int numScores;
int i;
numScores
scnr
nextInt
;
scoresList
new int
numScores
;
for
i
; i
scoresListlength;
i
scoresList
i
scnr
nextInt
;
System.out.print
Raw scores:
;
for
i
; i
scoresListlength;
i
System.out.print
scoresList
i
;
System.out.println
; System.out.print
Adjusted scores:
;
for
i
; i
scoresListlength;
i
System.out.print
scoresList
i
;
System.out.println
;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
