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

This preview shows page 1 out of 1 page.

import java.util.Scanner; /** * @author Jiacheng Ding * @version 9/30/2019 */ public class Patterns { /** * * @param args class */ public static void main(String[] args) { Scanner scnr = new Scanner(System.in); char a; int b; int j; int i; System.out.println("Enter pattern:"); a = scnr.next().charAt(0); System.out.println("Enter a positive integer between 1 and 10 inclusive:"); b = scnr.nextInt(); if (a == 'H') { for (i = 0; i < b; i++) { System.out.print("*"); } } else if (a == 'V') {

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture