EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
9th Edition
ISBN: 9781337671385
Author: FARRELL
Publisher: CENGAGE LEARNING - CONSIGNMENT
bartleby

Videos

Expert Solution & Answer
100%
Book Icon
Chapter 6, Problem 8PE

Explanation of Solution

Program:

File name: “QuizScoreStatistics.java

//Import necessary header files

import java.util.Scanner;

//Define a class named QuizScoreStatistics

public class QuizScoreStatistics

{

    //Define main method

    public static void main(String[] args)

    {

        //Create an object for Scanner class

        Scanner sc = new Scanner(System.in);

        //Declare the variables

        int count = 0;

        int score = -1;

int min = Integer.MAX_VALUE, max = Integer.MIN_VALUE, sum = 0;

        //Prompt the user to enter the scores

        System.out.println("Enter the scores: (to stop enter 99) ");

        //do..while loop

        do

        {

            //Reads a string of digits

            score = sc.nextInt();

/*If the user enters any number of student quiz scores other than 99*/

            if (score != 99)

            {

//If the score entered is less than 0 or more than 10

                if (score < 0 || score > 10)

                {

                   //Print the message

                   System.out.println("Score must be between 0 and 10");

                }

                //Else if the score lies between 0 and 10

                else

                {

                    //Increment the count

                    count++;

        �...

Blurred answer
Students have asked these similar questions
Write an application that allows a user to enter any number of student quiz scores, as integers, until the user enters 99. If the score entered is less than 0 or more than 10, display Score must be between 10 and 0 and do not use the score. After all the scores have been entered, display the number of valid scores entered, the highest score, the lowest score, and the arithmetic average.
Create an application that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Do not display the computer’s choice yet.)2. The user selects his or her choice of rock, paper, or scissors. To get this input you can use Button controls, or clickable PictureBox controls displaying some of the artwork that you will find in the student sample files.3. The computer’s choice is displayed.4. A winner is selected according to the following rules:• If one player chooses rock and the other player chooses scissors, then rock wins. (Rock smashes scissors.)• If one player chooses scissors and the other player chooses paper, then scissors wins. (Scissors cuts paper.)• If one player chooses…
Write an application that handles a student report card. The application shall save the marks of computer science, math and English. Each subject has a total of 50 marks. If a student obtains at least 75/150 marks, an event will trigger and show a congratulation message on passing the exam. Otherwise, it will display an “F” grade.
Knowledge Booster
Background pattern image
Computer Science
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
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Files & File Systems: Crash Course Computer Science #20; Author: CrashCourse;https://www.youtube.com/watch?v=KN8YgJnShPM;License: Standard YouTube License, CC-BY
UNIX Programming (Part - 10) The File System (Directories and Files Names); Author: ITUTEES;https://www.youtube.com/watch?v=K35faWBhzrw;License: Standard Youtube License