My code looks like this:
public class HourGlass{
public static final int x = 5;
public static void wall(){
System.out.println("|\"\"\"\"\"\"\"\"\"|");
}
public static void top(){
for (int i = 1;i<=x;i++){
for (int j =1; j<=i; j++){
System.out.print(" ");
}
System.out.print("\\");
for (int k = 1; k <= 9-2*i ;k++){
System.out.print(":");
}
System.out.print("/\n");
}
}
public static void bottom(){
for (int i = 1;i <= x; i++){
for (int j = 1; j<= 5-i; j++){
System.out.print(" ");
}
System.out.print("/");
for (int k = 1; k <= 2*i-1; k++){
System.out.print(":");
}
System.out.print("\\\n");
}
}
public static void main(String[] args){
wall();
top();
bottom();
wall();
}
}
And I get this:
|"""""""""|
\:::::::/
\:::::/
\:::/
\:/
\/
/:\
/:::\
/:::::\
/:::::::\
/:::::::::\
|"""""""""|
How would I go about fixing this and making the bottom and top scale? I have tried to figure out how to solve this issue but I am rather stuck and have not found anything.