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

Concept explainers

bartleby

Videos

Expert Solution & Answer
Book Icon
Chapter 6, Problem 14PE

Explanation of Solution

Program:

File name: “BarChart2.java

//Import necessary header files

import java.util.Scanner;

//Define a class named BarChart2

class BarChart2

{

    //Define main method

    public static void main(String args[])

    {

        //Declare an array of names

        String[] playerNames = {"Art", "Bob", "Cal", "Dan", "Eli"};

        //Declare an array for storing points

        int[] points = new int[5];

        //Declare the variables

        int i, j;

        //Create an object for the Scanner class

        Scanner sc = new Scanner(System.in);

        //For loop for reading the points scored

        for(i=0; i<5; i++)

        {

//Prompt the user to enter the points scored by each player

System.out.print("Enter points earned by " + playerNames[i] + " >> ");

            points[i] = sc.nextInt();

        }

        //Print the result

        System...

Blurred answer
Students have asked these similar questions
TOPICS: Data and Expressions MUST BE IN JAVA. PLEASE USE COMMENTS AND WRITE THE CODE IN SIMPLEST FORM.  Write an application that reads a value representing a number of seconds, then displays the equivalent amount of time as a combination of hours, minutes, and seconds. For example, 9999 seconds is equivalent to 2 hours, 46 minutes, and 39 seconds. Hint: This requires using the % modulus operator. The trick with multiple units of measure like this is to start with the largest unit (hours) and work down. Testing: Submit testing exhibits using the following inputs: 0, 1, 60, 3600, 3661, and 9999
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.
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. 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     PLEASE WRITE A JAVA CODE   import java.util.*; public class QuizScoreStatistics {     public static void main (String args[]) {         // Write your code here     } }
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
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY