This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Udacity exercise. Just posted the code here to help anyone who wanted to see the work behind my posted result. | |
__author__ = 'Michael Rosata mrosata1984@gmail.com' | |
__package__ = '' | |
from random import random | |
import turtle | |
class TurtleArtist(turtle.Turtle): | |
_origin = (0, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int numberOfSmoothiesTillPrize = 10; | |
if (numberOfSmoothiesTillPrize > 9) { | |
Log.v("SmoothieActivity", "Congratulations, you get a free smoothie!"); | |
numberOfSmoothiesTillPrize = numberOfSmoothiesTillPrize - 10; | |
} else { | |
Log.v("SmoothieActivity", "No free smoothie this time."); | |
} | |
Log.v("SmoothieActivity", "You currently have " + numberOfSmoothiesTillPrize + " out of 10 smoothies needed for your next free smoothie."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calculates the price of the order based on the current quantity. | |
* | |
* @return the price | |
*/ | |
private int calculatePrice(int price]) { | |
int calculatePrice = price * 5; | |
return calculatePrice; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<view android:layout_width="1dp" | |
android:layout_height="match_parent" | |
android:background="@android:color/darker_gray" | |
android:layout_marginTop="16dp"/> |