Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Android for Beginners : If/Else Weather Quiz
boolean isRaining = false;
Log.v("WeatherActivity", "Thank you for using the WhetherWeather App.");
if (isRaining) {
Log.v("WeatherActivity", "It's raining, better bring an umbrella.");
} else {
Log.v("WeatherActivity", "It's unlikely to rain.");
}
@udacityandroid

This comment has been minimized.

Copy link
Owner Author

udacityandroid commented Nov 3, 2015

Please do not post the answer to this quiz in the comments. This gives others a chance to learn on their own. Thank you for your cooperation!

@SaiMun92

This comment has been minimized.

Copy link

SaiMun92 commented Jan 31, 2016

lol

@yaxyeports

This comment has been minimized.

Copy link

yaxyeports commented Feb 5, 2016

i almost made through this course. interesting!

@Beennie

This comment has been minimized.

Copy link

Beennie commented Jun 17, 2016

So guys, here is the anwser:........
Get your lazy ass up and solve it on your own! ;-p

@katiepencil

This comment has been minimized.

Copy link

katiepencil commented Jul 27, 2016

boolean isRainingInMinnesota = true;

@nirzhar

This comment has been minimized.

Copy link

nirzhar commented Sep 2, 2016

boolean isRainingInSouthernCalifornia = nevertrue;

@sinithwar

This comment has been minimized.

Copy link

sinithwar commented Nov 9, 2016

Sometimes I view these comments when I know my answer is technically correct, but I did it in a different way than the instructions. Oh, that silly preference abstraction, how it gets me in trouble.

@lillychangx

This comment has been minimized.

Copy link

lillychangx commented Dec 12, 2016

boolean KatherineKuanIsSexy = True;

@nabarun1011

This comment has been minimized.

Copy link

nabarun1011 commented Jan 5, 2017

💻

@bikki123

This comment has been minimized.

Copy link

bikki123 commented Feb 17, 2017

yeah

@HadziMir

This comment has been minimized.

Copy link

HadziMir commented Mar 23, 2017

love you guys! Udacity is great program! I am happy to learn with you!

@MakerShooter

This comment has been minimized.

Copy link

MakerShooter commented Mar 27, 2017

what is important here - if you put if (someboolenvariable) so you only check what is the value of the variable and then process with that.

@sabinaioana25

This comment has been minimized.

Copy link

sabinaioana25 commented Mar 27, 2017

I love this program! You guys rock!

@Alokkumar8

This comment has been minimized.

Copy link

Alokkumar8 commented Apr 29, 2017

great course.

@Guillermo-Perez

This comment has been minimized.

Copy link

Guillermo-Perez commented Sep 28, 2017

the answer is:
boolean doTheHomework = true;
String messageForYou = "Study, try again, try harder!" ;

@Afandy1

This comment has been minimized.

Copy link

Afandy1 commented Dec 8, 2017

yes, I like it

@caioguedesbra

This comment has been minimized.

Copy link

caioguedesbra commented Jan 9, 2018

Great Udacity, thank you once again!

@sskreber

This comment has been minimized.

Copy link

sskreber commented Jan 15, 2018

boolean isSnowingInBudapest = true;
Log.v("CoderActivity", "Captain's log: We are still on this alien planet called Java. It is proving to be less and less hostile.");

@mezdour

This comment has been minimized.

Copy link

mezdour commented Jan 30, 2018

thank you

mezdour mohamed

@osamasarhan

This comment has been minimized.

Copy link

osamasarhan commented Feb 2, 2018

thanks

@osamasarhan

This comment has been minimized.

Copy link

osamasarhan commented Feb 2, 2018

false

@Maxwe1

This comment has been minimized.

Copy link

Maxwe1 commented Feb 8, 2018

the else is true.

@Nogaeman

This comment has been minimized.

Copy link

Nogaeman commented Feb 15, 2018

Thank you for using the WhetherWeather App.
It's unlikely to rain.

@abdahma01

This comment has been minimized.

Copy link

abdahma01 commented Feb 24, 2018

Thank you for using the WhetherWeather App.
It's unlikely to rain

@Alimamasy

This comment has been minimized.

Copy link

Alimamasy commented Feb 24, 2018

the choice C, thanks

@badrddinb

This comment has been minimized.

Copy link

badrddinb commented Mar 7, 2018

DONE

@xbarakota

This comment has been minimized.

Copy link

xbarakota commented Mar 18, 2018

C

@opeolat

This comment has been minimized.

Copy link

opeolat commented Mar 28, 2018

I have recommended Udacity for my friends, you know the only regret I have is I did not start this earlier...feel I have lost so much time...Dont know if I will have time to become the kind of expert I will want to be in the next 3 months...You guys are the very best...THANK YOU!!!!!!!!!!!!!

@ahmedmofreh

This comment has been minimized.

Copy link

ahmedmofreh commented Mar 31, 2018

Thank you for using the WhetherWeather App.
It's unlikely to rain.

@abdobasha2004

This comment has been minimized.

Copy link

abdobasha2004 commented Apr 3, 2018

C

@teebonez28

This comment has been minimized.

Copy link

teebonez28 commented Apr 3, 2018

Please stop being so mean to others. I get that people don't always want to see the answers, but it could be said differently. Kindness goes a long way!

@prbehere93

This comment has been minimized.

Copy link

prbehere93 commented May 5, 2018

A question, if the control statement is changed such that,
boolean isRaining = false;
Log.v("WeatherActivity", "Thank you for using the WhetherWeather App.");
if (isRaining==false) {
Log.v("WeatherActivity", "It's raining, better bring an umbrella.");
} else {
Log.v("WeatherActivity", "It's unlikely to rain.");
}

Will the statement inside 'if' be executed or will it give some kind of error?

@shoooka

This comment has been minimized.

Copy link

shoooka commented May 15, 2018

interesting

@Eduese

This comment has been minimized.

Copy link

Eduese commented May 28, 2018

Okay, this is similar to the example in the video. Let me go back to answer my quiz

@JacquesInnocent

This comment has been minimized.

Copy link

JacquesInnocent commented Jun 10, 2018

Let me just ran back to the video and submit my right answer LOL

@dennismichael796

This comment has been minimized.

Copy link

dennismichael796 commented Jun 11, 2018

thats interesting

@Fury4hwxc

This comment has been minimized.

Copy link

Fury4hwxc commented Jun 26, 2018

thanks 👍

@djalilo24

This comment has been minimized.

Copy link

djalilo24 commented Apr 1, 2019

C

@YassineOuardini

This comment has been minimized.

Copy link

YassineOuardini commented Apr 9, 2019

Question C Because isRaining is false, though, it will print the Else Statement to the logs, which is "It's unlikely to rain".

@YassineOuardini

This comment has been minimized.

Copy link

YassineOuardini commented Apr 9, 2019

Question C Because isRaining is false, though, it will print the Else Statement to the logs, which is "It's unlikely to rain".

@Dexaan

This comment has been minimized.

Copy link

Dexaan commented Jul 22, 2019

boolean isRainingInVancouver = true;

@ElikplimSunu

This comment has been minimized.

Copy link

ElikplimSunu commented Mar 4, 2020

Wow we've come a really long way :)

@Ali-FF

This comment has been minimized.

Copy link

Ali-FF commented May 29, 2020

let's do this course together mail me at izaneqwan@gmail.com

@allouane

This comment has been minimized.

Copy link

allouane commented Jun 4, 2020

It's unlikely to rain. because the isRaining boolean is false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.