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: