-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpaceNeedle.java
More file actions
139 lines (120 loc) · 3.45 KB
/
SpaceNeedle.java
File metadata and controls
139 lines (120 loc) · 3.45 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* Name: Charlie LeWarne and Maddie Herrmann
Assignment: Lab #05
Title: Space Needle
Course: CS 144
Class section: 2
Lab Section: 1
Semester: Spring 2019
Instructor: Dr.Cao
Date: 3-21-19
Sources consulted:
Known Bugs:
Program description: This program allows the user to insert a number for a scale
to produce a space needle that fits the users scale.
Creativity: anything extra that you added to the lab
Instructions: Enter a number for scale to see space needle.
*/
import java.util.Scanner;
public class SpaceNeedle
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
int scaleSize;
System.out.println("Enter scale size: ");
scaleSize = keyboard.nextInt();
//tip of needle
for (int i = 1; i <= scaleSize; i++)
{
for (int space = 1; space <= (2 * scaleSize) + 10; space++)
{
System.out.print(" ");
}
System.out.println("||");
}
//needle round top
for (int line = 1; line <= scaleSize; line++)
{
for (int space = 1; space <= (((2 * scaleSize) + 9) - (line * 3)) + 1; space++)
{
System.out.print(" ");
}
System.out.print("__/");
for (int j = 1; j <= line-1; j++) {
System.out.print(":::");
}
System.out.print("||");
for (int j = 1; j <= line-1; j++) {
System.out.print(":::");
}
System.out.println("\\__");
}
//needle round middle
for (int space = 1; space <= (((2 * scaleSize) + 9) - (scaleSize * 3)) + 1; space++)
System.out.print(" ");
System.out.print("|");
for (int i = 1; i <= scaleSize; i++)
{
System.out.print("\"\"\"\"\"\"");
}
System.out.println("|");
//needle round base
for (int line = 1; line <= scaleSize; line++)
{
for (int space = 1; space <= (scaleSize + (line * 2) - (scaleSize * 2 - 7)) + 1; space++)
{
System.out.print(" ");
}
System.out.print("\\_");
for (int j = 1; j <= (((scaleSize*3)+1) - (line*2)); j++)
{
System.out.print("/\\");
}
System.out.println("_/");
}
//needle middle A
for (int i = 1; i <= scaleSize; i++)
{
for (int space = 1; space <= (2 * scaleSize) + 10; space++)
{
System.out.print(" ");
}
System.out.println("||");
}
//needle middle B
for (int line = 1; line <= scaleSize * scaleSize; line++)
{
for (int space = 1; space <= (2 * scaleSize) + 7; space++)
{
System.out.print(" ");
}
System.out.println("|%%||%%|");
}
//needle base
for (int line = 1; line <= scaleSize; line++)
{
for (int space = 1; space <= (((2 * scaleSize) + 9) - (line * 3)) + 1; space++)
{
System.out.print(" ");
}
System.out.print("__/");
for (int j = 1; j <= line-1; j++) {
System.out.print(":::");
}
System.out.print("||");
for (int j = 1; j <= line-1; j++) {
System.out.print(":::");
}
System.out.println("\\__");
}
//needle bottom
for (int space = 1; space <= (((2 * scaleSize) + 9) - (scaleSize * 3)) + 1; space++)
System.out.print(" ");
System.out.print("|");
for (int i = 1; i <= scaleSize; i++)
{
System.out.print("\"\"\"\"\"\"");
}
System.out.println("|");
}
}