Untitled
unknown
plain_text
2 years ago
3.4 kB
10
Indexable
"""
Georgia Institute of Technology - CS1301
Homework 01 - Functions & Expressions
"""
#########################################
"""
Function Name: ratsNightTrivia()
Parameters: N/A
Returns: None
"""
def ratsNightTrivia():
name = input ("What is the name of Georgia Tech's fight song?")
print("You answered:{}".format(name))
print("The right answer is: Ramblin' Wreck from Georgia Tech")
print ("")
name2 = input ("What's the good word?")
print("You answered:{}".format(name2))
print("The right answer is: To hell with georgia")
ratsNightTrivia()
#######################################
"""
Function Name: rockRambleRoll()
Parameters: N/A
Returns: None
"""
def rockRambleRoll():
pizzas = input ("How many pizzas do you want at Campus Crust?")
sand = input ("How many sandwiches do you want at 5th Street Deli?")
sushi = input ("How many sushi rolls do you want at Bento Sushi?")
taco = input ("How many tacos do you want at Twisted Taco?")
pizza2 = float(pizzas) * 9.00
sand2 = float(sand) *5.50
sushi2 = float (sushi) * 8.00
taco2 = float (taco) * 2.25
total = pizza2 + sand2 + sushi2 + taco2
print ("You need to spend $" + str(total)+ " at Rock, Ramble, and Roll.")
#######################################
"""
Function Name: houseParty()
Parameters: N/A
Returns: None
"""
def houseParty():
autographs = input("How many autographs will you get?")
bouncycast = input("How many times will you visit the bouncy castle?")
vidgamcon = input("How many video game contests will you participate in?")
lockroom = input ("How many times will you walk through the locker rooms?")
autographs2 = int(autographs) * 10
bouncycast2 = int(bouncycast) * 20
vidgamcon2 = int(vidgamcon) * 45
lockroom2 = int(lockroom) * 15
total = autographs2 + bouncycast2 + vidgamcon2 + lockroom2
hourtotal = total//60
minutetotal = total/60
minutetotal2 = (minutetotal - hourtotal) * 60
print ("You will spend " + str(int(hourtotal)) + " hour(s) and " + str(int(minutetotal2)) + " minutes at the house party.")
#########################################
"""
Function Name: budget()
Parameters: N/A
Returns: None
"""
def budget():
monthly = input("What is your monthly income?")
percentage = input ("What percentage of your income do you want to save?")
leftover = float(monthly) - 900.
save = float(percentage) / 100
howmuchcan = float(monthly) * float(save)
youspend = float(leftover) - float(howmuchcan)
print ("You can save $" + str(howmuchcan) + " and spend $" + str(youspend) + " this month.")
#########################################
"""
Function Name: spareTime()
Parameters: N/A
Returns: None
"""
def spareTime():
credithr = input ("How many credit hours are you taking?")
extracr = input ("How many hours will you devote to extracurricular activities each day?")
study = int(credithr)*3
lecturehr = int(credithr) * 1
ecs = int(extracr) * 7
hrsleft = 112-(study + lecturehr + ecs)
sparehr = int(hrsleft)//7
sparemin = ((float(hrsleft)/7)-sparehr)*60
roundsparemin = round (sparemin, 1)
print ("You have " + str(sparehr) + " hour(s) and " + str(roundsparemin) + " minutes per day to spare.")
#########################################
Editor is loading...