- Provided Quiz7_averageScores_00.Java Modify this program to 1. Request certain number of decimals in certain range a. the decimal is within certain range (0-100) } b. user will decide how many scores to enter 2. Calculate the average 3. Display the result in certain format import java.util.Scanner; public class Quiz7_averageScores_00 { public static void main(String[] args) { System.out.println("This is a program for Quiz7 by Li Ma.\n"); //use your name instead } int cnt=0; double v, total=0; double avg; Scanner minput = new Scanner(System.in); //Request certain number of scores //repeat requesting 5 times to get 5 scores int i=0; while (i<5) { } System.out.print("Please enter a score (0-100): "); v = minput.nextDouble(); total += v; cnt++; i++; //Calculate the average avg total/cnt; //Display the result in certain format System.out.printf("The average of entered scores is %.1f", avg);

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 2PE
icon
Related questions
icon
Concept explainers
Question

Can you the modifications specified in the comments to this java program

Quiz7_averageScores_00.Java
Modify this program to
1. Request certain number of decimals in certain range
a. the decimal is within certain range (0-100)
}
* 2. Calculate the average
3. Display the result in certain format
b. user will decide how many scores to enter
*/
import java.util.Scanner;
public class Quiz7_averageScores_00
{
Provided
}
public static void main(String[] args) {
System.out.println("This is a program for Quiz7 by Li Ma.\n"); //use your name instead
int cnt=0;
double v, total=0;
double avg;
Scanner minput = new Scanner(System.in);
//Request certain number of scores
//repeat requesting 5 times to get 5 scores
int i=0;
while (i<5) {
}
System.out.print("Please enter a score (0-100): ");
V = minput.nextDouble();
total += v;
cnt++;
i++;
//Calculate the average
avg total/cnt;
//Display the result in certain format
System.out.printf("The average of entered scores is %.1f", avg);
Transcribed Image Text:Quiz7_averageScores_00.Java Modify this program to 1. Request certain number of decimals in certain range a. the decimal is within certain range (0-100) } * 2. Calculate the average 3. Display the result in certain format b. user will decide how many scores to enter */ import java.util.Scanner; public class Quiz7_averageScores_00 { Provided } public static void main(String[] args) { System.out.println("This is a program for Quiz7 by Li Ma.\n"); //use your name instead int cnt=0; double v, total=0; double avg; Scanner minput = new Scanner(System.in); //Request certain number of scores //repeat requesting 5 times to get 5 scores int i=0; while (i<5) { } System.out.print("Please enter a score (0-100): "); V = minput.nextDouble(); total += v; cnt++; i++; //Calculate the average avg total/cnt; //Display the result in certain format System.out.printf("The average of entered scores is %.1f", avg);
* Quiz7_averageScores_00.Java
- Provided
Modify this program to
* 1. Request certain number of decimals in certain range
*
a. the decimal is within certain range (0-100)
2
b. user will decide how many scores to enter
2. Calculate the average
* 3. Display the result in certain format
Transcribed Image Text:* Quiz7_averageScores_00.Java - Provided Modify this program to * 1. Request certain number of decimals in certain range * a. the decimal is within certain range (0-100) 2 b. user will decide how many scores to enter 2. Calculate the average * 3. Display the result in certain format
Expert Solution
Step 1

We have been given a java program on which we have to provide the required modifications-

1. Request certain number of decimals in certain range a. the decimal is within certain range (0-100)
b. user will decide how many scores to enter
2. Calculate the average
3. Display the result in certain format

 

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning