Page 1 of 1

Problem Description In this problem, you will write a program that reads a number of *and a shape number, and then draw

Posted: Sun Jul 03, 2022 11:59 am
by answerhappygod
Problem Description In This Problem You Will Write A Program That Reads A Number Of And A Shape Number And Then Draw 1
Problem Description In This Problem You Will Write A Program That Reads A Number Of And A Shape Number And Then Draw 1 (47.65 KiB) Viewed 21 times
import java.util.Scanner;
public class Problem4{ public static void main(String[] args){
Problem Description In this problem, you will write a program that reads a number of *and a shape number, and then draw that shape with the specified number of *. Input You will receive [from the user] the following as input (in order]: • An int specifying the number of * to be drawn • An int specifying which shape to drawn Processing 1. Using the given number of * and the shape number, drawn the following shapes: ****** ****** ****** ****** ****** ****** Shape 1 A cube with the same number of columns and rows *** *** *** *** *** *** Shape 2 A rectangle with twice the number of rows than columns. ****** ***** **** *** ** * Shape 3 An inverted pyramid that goes from the number of * to 1.
Examples Input LO 6 LO 3 Output ****** ****** ****** ****** ****** ****** *** *** *** *** *** *** ****** ***** **** ***