-
Notifications
You must be signed in to change notification settings - Fork 0
/
FigurePrinter
43 lines (40 loc) · 1.28 KB
/
FigurePrinter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*Ishan Singh
9/27/2022
Project Three
Printing a specific figure using static methods*/
import java.util.Scanner();
public class FigurePrinter {
public static void drawFigure(String whichhalf) {
//Printing something based on if they want a top half, bottom half, or a line
if (whichhalf.equals("T")) {
System.out.println(" _______");
System.out.println(" / \\");
System.out.println("/ \\");
}
else if (whichhalf.equals("B")) {
System.out.println("\\ /");
System.out.println(" \\_______/");
}
else if (whichhalf.equals("L")) {
System.out.println("-\"-'-\"-'-\"-");
}
}
public static void main (String[] args) {
// call a method that draws the hexagon halves
int x = 0;
while (x < 2) {
drawFigure("T");
drawFigure("B");
drawFigure("L");
x++;
}
drawFigure("B");
drawFigure("T");
drawFigure("L");
drawFigure("B");
Scanner userinput = new Scanner(System.in);
System.out.println("Print a string of letters to create a figure. Ex: BTL would create a figure with a bottom half, then a top half, then a comma dash line");
userfigure = userinput.nextLine();
for
}
}