This forum is now read-only. Please use our new forums! Go to forums

banner
Close banner
0 points
Submitted by CodersUnited
over 9 years

12/15 I am so confused and stuck

I’ve tried using the statements that code academy had already put as an example which was probably really stupid but I was just really looking for an easy way to write an if/else statement. Like what should I write for the if/else statement should I write something like if (this is an ex;) ( 8 < 3 ) equals false then circle?? That’s what I am so confused about! I have pressed hint so many times, but it’s not really helping me at all. as you guys can probably see I’m really frustrated sorry if this is something stupid to fuss about but I just really need help. Please reply if you can help with nice comments please.

Blockquote

Answer 549efacb95e3780e5a010718

2 votes

Permalink

Hi CodersUnited,

Here is how an if statement works - once you understand that then you will find it much easier to get the results you are looking for.

    if (this is true) {
        do this thing;
    } else {
        do this other thing;
    }

See how much that helps you think about this problem and come back and let me know how you got on with that.

points
Submitted by Judy
over 9 years

2 comments

CodersUnited over 9 years

Still having trouble

Judy over 9 years

Let me have a look at the if statement that you have built so far. Then we can talk about the parts you are having trouble with.

Answer 54abf6ff76b8fe9871001600

0 votes

Permalink

same problem , my code look like this

var red = [33, 100, 63]; var orange = [40, 100, 60]; var green = [75, 100, 40]; var blue = [196, 77, 55]; var purple = [280, 50, 60];

var myName = “Abhishek”; letterColors=[red, orange, blue, purple, green] if(15>5) { bubbleShape= “Circle” } else { bubbleShape= “square” }

drawName(myName, letterColors);

points
Submitted by Abhishek
over 9 years

3 comments

Judy over 9 years

Use all lowercase: “circle”

Abhishek over 9 years

one thing more why we use 15>5 . can we use anything which is true

Judy over 9 years

There is no particular reason for using 15>5, you can definitely use anything that is true or you can use something false and switch the bubbleShape=”circle” to the false section.

Answer 54b81b3f51b887806c00372d

0 votes

Permalink

my code isn’t working either this is my code

var red = [0, 100, 63]; var orange = [40, 100, 60]; var green = [75, 100, 40]; var blue = [196, 77, 55]; var purple = [280, 50, 60];

var myName = “Jordan”; letterColors = [red, blue, green]

if(20>5) { bubbleshape = “circle”; }

else { bubbleshape = “square”; }

drawName(myName, letterColors);

but it keeps saying use a if/else statement

points
Submitted by Jordan Duenas
over 9 years

3 comments

Judy over 9 years

Hi Jordan, bubbleshape should be bubbleShape.

Jordan Duenas over 9 years

thanks i dint see that

Judy over 9 years

You’re welcome, it’s easy to miss.