Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

mostafa salah zaghloul mostafazaghlol

🏠
Working from home
Block or report user

Report or block mostafazaghlol

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@udacityandroid
udacityandroid / Code snippet in InboxActivity.java
Last active Jun 29, 2019
Android for Beginners : If/Else Email Quiz
View Code snippet in InboxActivity.java
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.";
@udacityandroid
udacityandroid / Code snippet in WeatherActivity.java
Last active Jul 22, 2019
Android for Beginners : If/Else Weather Quiz
View Code snippet in WeatherActivity.java
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.");
}
View Calculate price method
/**
* Calculates the price of the order.
*
* @param quantity is the number of cups of coffee ordered
*/
private void calculatePrice(int quantity) {
int price = quantity * 5;
}
You can’t perform that action at this time.