I have a txt file with numbers and I must read the file and print stars depending on the numbers that I am given.How can i do that?
public class Testing
{
public static void main(String [] args)
throws IOException
{
FileInputStream fileInputStream = new FileInputStream("numbers.txt");
Scanner scanner = new Scanner(fileInputStream);
double doubleNum=(scanner.nextDouble());
int intNumb=(int) doubleNum;
for (int i=0;i<intNumb;i++)
while (scanner.hasNextInt())
{
System.out.println("*");
}
}
}