Hi,
I writ a program that asks the user to input an integer and according to this integer the program should print astrisks equal to the input integer . The program does not compile ??
i need help fix this problem :
import java.util.Scanner;
public class Astrisksline {
public static void main (String[] args) {
do {
int x=0;
count=0;
sum=0;
Scanner keyboard= new Scanner(System.in);
System.out.print("\nPlease enter an integer or(Exit) to stop:");
x=keyboard.nextInt();
while (x>=0) {
count++;
sum = sum + x;
System.out.print("*");
System.out.print("Please enter an integer or (Exit) to stop:");
x=keyboard.nextInt();
}
}