Skip to content

Instantly share code, notes, and snippets.

@udacityandroid
Last active February 6, 2023 13:53
Show Gist options
  • Star 44 You must be signed in to star a gist
  • Fork 19 You must be signed in to fork a gist
  • Save udacityandroid/30774906a4fc87b31d0b to your computer and use it in GitHub Desktop.
Save udacityandroid/30774906a4fc87b31d0b to your computer and use it in GitHub Desktop.
Android for Beginners : If/Else Email Quiz
int numberOfEmailsInInbox = 0;
int numberOfDraftEmails = 2;
String emailMessage = "You have " + numberOfEmailsInInbox + " emails. ";
String draftMessage = "You have " + numberOfDraftEmails + " email drafts.";
if (numberOfEmailsInInbox == 0) {
emailMessage = "You have no new messages. ";
}
if (numberOfDraftEmails == 0) {
draftMessage = "You have no new drafts.";
}
Log.v("InboxActivity", emailMessage);
Log.v("InboxActivity", draftMessage);
@mixspark
Copy link

ok

@zake0000
Copy link

zake0000 commented Apr 7, 2021

الكل يكتب الاجابة اصبحتوا علماء فالبرمجة الان ههه مفيش حد هيفهمني انان عارف غير لو عربي طبعا

@Harriskobia
Copy link

Option C is correct:

V/InboxActivity : You have no new messages.
V/InboxActivity : You have 2 email drafts.

@adiupd123
Copy link

V/InboxActivity: You have no new messages.
V/InboxAcitivity: You have 2 email drafts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment