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

Videos

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

Explanation of Solution

Program:

File name: “BarChart.java

//Import necessary header files

import java.util.Scanner;

//Define a class named BarChart

class BarChart

{

    //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
Please provide answer in C#:   Slot Machine Simulation A slot machine is a gambling device into which the user inserts money and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user. Create an application that simulates a slot machine. Figure 8-23 (on page 539 of your book) shows an example of how the form should look. The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols. You will find a set of fruit symbols attached to this dropbox for your use - from the Student Sample Programs provided by the book author.) If none of the randomly displayed images match, the program should inform the user that he or she has won…
In C# language using Microsoft Visual Studio in Windows Forms App (.NET Framework) A slot machine is a gambling device that the user inserts money into and then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money, which the slot machine dispenses back to the user. Design a program that simulates a slot machine. When the program runs, it should do the following: Ask the user to enter the amount of money he or she wants to insert into the slot machine. Create an application that simulates a slot machine.   The application should let the user enter into a TextBox the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display three randomly selected symbols. (Slot machines traditionally display fruit symbols.
JAVA Project 2-3 Rectangle Calculator Create an application that calculates the area and perimeter of a rectangle. Then using a loop, ask the user if they want to continue. If yes then repeat the input, processing, and output. If no then end the program. Console Welcome to the Area and Perimeter Calculator   Enter length: 100 Enter width:  200 Area:         20000.0 Perimeter:    600.0   Continue? (y/n): y     Specifications The formulas for calculating area and perimeter are: area = width * lengthperimeter = 2 * width + 2 * length The application should accept decimal entries like 10.5 and 20.65. Assume that the user will enter valid numeric data for the length and width. The application should continue only if the user enters “y” or “Y” to continue. Input: Print the header "Welcome to the Area and Perimeter Calculator" Ask the user to enter a length Ask the user to enter a width Processing: Save the length and width in variables Calculate the area and save the results in a variable…
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
Recommended textbooks for you
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
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,
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Graphical User Interfaces: Crash Course Computer Science #26; Author: CrashCourse;https://www.youtube.com/watch?v=XIGSJshYb90;License: Standard YouTube License, CC-BY
Python GUI | How To Make A GUI In Python | Best GUI Framework In Python | Edureka; Author: edureka!;https://www.youtube.com/watch?v=_PHJvjQJa3w;License: Standard Youtube License