Solve This Java - Win 8 SBD [Closed]

in contest •  7 years ago  (edited)


Source: Pexels


Hi guys, come and play this game. If you look below, there's a basic Java syntax.

Only 3 steps to this game:

  1. Find the answer to question One. It is a number (integer) and you have to use it for Question Two.
  2. Substitute the phrase "Find the number for this" with the number you found in Question One.
  3. Comment below this post, the sentence / phrase that you will get if you execute the code.

Question One

What is 2 + 2?

Question Two

Replace the value of the int Answer with the answer from question One and let me know what phrase / sentence you'll get. Has to be exact.


public class MyClass {
public static void main(String args[]) {

  int Answer = [Find the number for this];

    switch (Answer){

        case 3 : System.out.println("Hello Sir");
                            break; 
        case 9 : System.out.println("Upvote Pls");
                            break;
        case 11 : System.out.println("Follow Sir");
                            break;
        default:
            System.out.println("Flagged");
            
    }

}

}


First person to give the correct (exact) answer wins 8 SBD.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Answer for question 1...is 4
Answer for question 2...Upvote Pls

  ·  7 years ago (edited)

Flagged

I hope you are right man lol!

  ·  7 years ago (edited)

yes sure of it partner

Congrats on winning this challenge in just a few minutes after it was posted. The question didn't specify to remove the bracket so i apologize to the rest.

  ·  7 years ago (edited)

Thank you so much @howtostartablog. This is my 1st time to win a contest on steemit.

HelloWorld.java:4: error: illegal start of expression
int Answer = [4];
^
HelloWorld.java:4: error: not a statement
int Answer = [4];
^
HelloWorld.java:4: error: ';' expected
int Answer = [4];
^
3 errors

There should be no "[ ]" in the declaration. But you stated in Instruction no. 2.Substitute the phrase "Find the number for this" with the number you found in Question One.

Only the phrase will be replaced not including the brackets "[ ]".

wow this is all greek to me lol

Shouldn't have assumed you guys would remove the brackets, but i guess you knew what i was looking for :)

you should include the default string so it would be more challenging hahaha.. but this is a good one with a whooping prize.. Thank you

  ·  7 years ago (edited)

Q1=4
Q2= Error(s), warning(s):

Is there anything that you can't do

Hahaha.. natackle namin to during college hahaha..

/MyClass.java:4: error: illegal start of expression
int Answer = [4];
^
/MyClass.java:4: error: not a statement
int Answer = [4];
^
/MyClass.java:4: error: ';' expected
int Answer = [4];
^
3 errors

Is this still English lol

hehe. The contest asked for the exact answer meaning what the compiler displayed hehe

yeah right :)

Answer for q1 is : integer 4
Answer for q2 is : Flagged

I'm a bit late but looks like a fun competition it has been a while since i opened Eclipse too lol...

Loading...

Will ask someone from our community @steemitfamilyph as we have some developers. If you asked about food I might have known the answer hahaha

You guys have a discord?

Yeah we have mostly Filipino members but we have a couple of foreigners in the English Channel and we are all about inclusivity .

I was lucky looking at my feed when your contest rolled out haha Sent to discord and facebook. The perks of not doing anything while at work haha.

https://discord.gg/ta8UPKg

Ah i see. was just wondering how they came so quickly..

Q1: 4
Q2: Hello sir, Upvote pls, Follow sir

Flagged

Clicks on post, reads, sees code, dies.

i see code also die

Well some of the things went up over my head ;)

It was a mistake to put the brackets there, but i'll still reward the one who knew what i was looking for, since i mentioned phrase / sentence.

good work.