The program is to be answered in Java Programming not C++ Please answer the following: Modify the BarChart program to accept the number of points scored by each player in a season. The bar chart displays one asterisk for each 10 points scored by a player. For example, if a player has scored 48 points, then display four asterisks.

Answer :

Answer:

import java.util.Scanner;

public class BarChart {

public static void main(String[] args) {

Scanner sc=new Scanner(System.in);

//take input from user

System.out.println("Enter Score");

int score=sc.nextInt();

int count=score/10;

int i=1;

//print horizontal bar

//if you want to print vertical bar then simply change into print which is replace by println

while(i<=count)

{

System.out.print("*");

i++;

}

}

}

Explanation:

Other Questions