Java Programming, Loose-Leaf Version
Java Programming, Loose-Leaf Version
9th Edition
ISBN: 9781337685900
Author: FARRELL, Joyce
Publisher: Cengage Learning
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
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…
Please code in  javas, thank you Write a program that opens the salesdat.txt file and processes it contents. The program should display the following per store:The total sales for each week. (Should print 5 values - one for each week).The average daily sales for each week. (Should print 5 values - one for each week).The total sales for all the weeks. (Should print 1 value)The average weekly sales. (Should print 1 value)The week with the highest amount in sales. (Should print 1 week #)The week with the lowest amount in sales. (Should print 1 week #)All Values (Total Sales, Average Daily Sales for Each Week, Total Sales for all Weeks, Average Weekly Sales, Highest Amount in Sales, Lowest Amount in Sales) The file contains the dollars amount of sales that a retail store made each day for a number of weeks. Each line in the file contains thirty five numbers, which are sales numbers for five weeks. The number are separated by space.  Each line in the file represents a separate store. Please…
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 O or more than 10, display Score must be between 10 and O 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. An example of the program is shown below: Enter a score >> 6 Enter another score or 99 to quit >>» 7 Enter another score or 99 to quit >» 9 Enter another score or 99 to quit >» 7 Enter another score or 99 to quit >> 99 4 valid scores were entered Highest was 9 Lowest was 6 Average was 7.25
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
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781305480537
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
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