#I DO NOT GET WHAT IS WRONG WHAT DO I DO OMG
63 messages ยท Page 1 of 1 (latest)
โ This post has been reserved for your question.
Hey @mortal axle! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
how i do that
copy the link?
yes
public class TreeOfStars
{
public static void main(String[] args)
{
// Call makeATree
makeATree();
}
public static void makeATree(){
for(int i = 1; i <= 9; i++){
for(int j = 1; j<=9; j++){
System.out.println("* ");
}
System.out.println();
}
}
}
alright
haha i joined an hour ago im no pro but i think i can help you
uyaaaaaaaay
now it does this https://i.imgur.com/2D6XGkq.png
just gotta add the spaces hopefully
dun
{
public static void main(String[] args)
{
// Call makeATree
makeATree(8);
}
public static void makeATree(int height){
for(int i = height; i >=0 ; i = i-1){
for(int y = 0; y<=height-i; y++)
{
System.out.print(" ");
}
for(int x = 0; x<=i; x++)
{
System.out.print("* ");
}
System.out.print("\n");
}
}
}```
@mortal axle
it was great ๐
it was wrong
lol
it is good
idk how
there was a space difference
public class Main
{
public static void main(String[] args)
{
// Call makeATree
makeATree(8);
}
public static void makeATree(int height){
for(int i = height; i >=0 ; i = i-1){
for(int y = 0; y<=height-i; y++)
{
System.out.print(" ");
}
for(int x = 0; x<=i; x++)
{
System.out.print(" * ");
}
System.out.print("\n");
}
}
}
btw i did this
and still got it wrong
i did it both way
:C
NEVERMIND
i GOT IT
public class Main
{
public static void main(String[] args)
{
// Call makeATree
makeATree(9);
}
public static void makeATree(int height){
for(int i = height; i >=0 ; i = i-1){
for(int y = 1; y<=height-i; y++)
{
System.out.print(" ");
}
for(int x = 1; x<=i; x++)
{
System.out.print("* ");
}
System.out.print("\n");
}
}
}
was the answer
ahh
๐ค Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
Sorry but instead of just showing the result just explain them how fisrt and what is wrong to their original code. This is very common to happend but please don't do that because they will ask again sometimes
Close