- 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);

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education