Loops.java - \/Jaleesa Rodriguez IC3 CIS 340 T\/TH 1:30-2:45 import java.util.Scanner public class Loops cfw public static void main(String args cfw int

Loops.java - /Jaleesa Rodriguez IC3 CIS 340 T/TH...

This preview shows page 1 out of 1 page.

//Jaleesa Rodriguez, IC3, CIS 340, T/TH 1:30-2:45 import java.util.Scanner; public class Loops { public static void main(String[] args) { int counter = 0; Scanner scanner = new Scanner(System.in); System.out.println("I can build you a line of asterisks.\n"); System.out.print("How many asterisks do you want? "); int asteriskCount =Integer.parseInt(scanner.nextLine()); System.out.println("\nPrinting a line of asterisks using a while loop"); while (counter < asteriskCount) { System.out.print("*"); counter++;
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Summer '19
  • loop, Do while loop, 50

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture