Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 60, assign the element with 60.
Ex: If the input is:
3
3991100
then the output is:
Raw scores: 3991100
Adjusted scores: 396060 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=0; i scoresList. length; ++i){
scoresList [i]=scnr.nextInt(); } System.out.print("Raw scores: ");
for (i =0; i scoresList.length; ++i){
System.out.print(scoresList[i]+"");
}
System.out.println();
\\Your code here
System.out.print("Adjusted scores: ");
for (i =0; i scoresList.length; ++i){
System.out.print(scoresList[i]+"");
}
System.out.println();
}
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago