JAVA PROGRAMMING-LMS INTEG.MINDTAP
JAVA PROGRAMMING-LMS INTEG.MINDTAP
8th Edition
ISBN: 9781337091503
Author: FARRELL
Publisher: Cengage Learning
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
Pllleasassseee ssiiirrrr soolveee thissssss questionnnnnnn
Pllleasassseee ssiiirrrr soolveee thissssss questionnnnnnn
Pllleasassseee ssiiirrrr soolveee thissssss questionnnnnnn
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
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Python Tutorial #10; Math Functions in Python; Author: Art of Engineer;https://www.youtube.com/watch?v=OviXsGf4qmY;License: Standard YouTube License, CC-BY