Patterns.java - import [email protected] Jack...

This preview shows page 1 - 2 out of 2 pages.

import java.util.Scanner; /** * @author Jack Closson * @version 10/1 * Intro to CS * This program reads trials conducted on materials */ public class Patterns { /** * public class Aquapodz1. * * @param args String[] */ public static void main(String[] args) { String pattern; int num; Scanner scan = new Scanner(System.in); System.out.println("Enter pattern:"); pattern = scan.next(); if (pattern.equals("H")) { System.out.println("Enter a positive integer between 1 and 10 inclusive:"); num = scan.nextInt(); for (int i = 0; i < num; i++) { System.out.print("*"); } } else if (pattern.equals("V")) { System.out.println("Enter a positive integer between 1 and 10 inclusive:"); num = scan.nextInt(); for (int i = 0; i < num; i++) {

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture