Skip to content

Instantly share code, notes, and snippets.

@Nerajno
Last active November 2, 2017 15:48
Show Gist options
  • Save Nerajno/cc29fb1f4f56223a3c19e055c96b403a to your computer and use it in GitHub Desktop.
Save Nerajno/cc29fb1f4f56223a3c19e055c96b403a to your computer and use it in GitHub Desktop.
HW 2
# # # Lesson 2 Exercises
#
# # ## NOTE Degree Conversion Calculator 1
# # Ask the user for a temperature in Fahrenheit, tell them the equivalent
# # temperature in Celsius.
# #
# # # Solutions
# # query = int(input(" What is the temperature in Fahrenheit ?"))
# # conversion_to_Celius = (query-32)*0.5556
# # Sentence0 = "The temperature is "
# # Sentence1 = " degrees Celcius."
# # print(Sentence0,conversion_to_Celius,Sentence1)
#
# # ## NOTE Degree Conversion Calculator 2
# # Same as the first calculator, but convert from Celsius to Fahrenheit.
# #
# # # Solutions
# # query = int(input(" What is the temperature in Celcius ?"))
# # conversion_to_Fahreheit = (query*1.8) + 32
# # Sentence0 = "The temperature is "
# # Sentence1 = " degrees Fahrenheit."
# # print(Sentence0,conversion_to_Fahreheit,Sentence1)
#
# # ## NOTE Degree Conversion Calculator 3
# # Combine the 2 previous calculators into one program. First ask them to enter
# # a number: either 1 or 2. If they entered 1, ask for the temperature in
# # Fahrenheit and convert it to Celsius. If they entered 2, ask for the
# # temperature in Celsius and convert it to Fahrenheit.
#
# #Solutions
# # number_selector = int(input("Enter a number: either 1 or 2"))
# # query_Celcius = int(input("What is the temperature in degrees Celsius ?"))
# # query_Fahrenheit = int(input("What is the temperature in degrees Fahrenheit ?"))
# # response0 = "The temperature is "
# # response_Celcius = "degrees Celcuis."
# # response_Fahrenheit = " degrees Fahrenheit."
#
# # number_selector = int(input("Please enter either the numbers 1 or 2 "))
# # if number_selector == 1:
# # query_Fahrenheit = int(input("What is the temperature in degrees Fahrenheit ? "))
# # conversion_to_Celius = (query_Fahrenheit-32)*0.5556
# # print(response0,conversion_to_Celius,response_Celcius)
# # elif number_selector == 2:
# # query_Celcius = int(input("What is the temperature in degrees Celsius ? "))
# # conversion_to_Fahreheit = (query_Celcius*1.8) + 32
# # print(response0, conversion_to_Fahreheit,response_Fahrenheit)
# # else:
# # print("these aren't the droids you're looking for")
#
# # #** Check if they put in 1 or 2, if not print out another respone"These are not the input we are looking for"
#
#
# ## NOTE How Much Did You Save?
# # You have a coupon. If says if you buy $50.00 worth of products or more,
# # you save 20%. If you buy less than $50.00 worth of products, you save %12.
# # Ask the user what is their purchase and tell them what's the new total after
# # the coupon is applied, and also tell them how much they saved.
#
# # Solutions
# # print("Do you want to save some money ?, We have coupons ")
# # query = int(input("What is the total amount of your purchase ? $ "))
# # coupon_a = query/100*20
# # coupon_b = query/100*12
# # Sentence0 = "You saved is $"
# # Sentence1 = "."
# # Sentence2 = "Your total is $"
# # if query >= 50:
# # print(Sentence2,query - coupon_a,Sentence1)
# # print(Sentence0, query-(query-coupon_a),Sentence1)
# # else:
# # print(Sentence2,query-coupon_b,Sentence1)
# # print(Sentence0, query-(query-coupon_b),Sentence1)
#
#
# #NOTE ## Price of the ride
# #
# # A carnival ride costs $12.00 for adults; $6 for kids (12 or under);
# # $7 for senior citizens (60 or older). You have to be at least 48 inches to
# # ride.
# # Write a program to ask the user for their age and then their height. If
# # they qualify to ride, tell them the cost of their ride. If they do not
# # qualify to ride, tell them that they cannot ride.
#
# # Solutions
# # ride_height = 48
# # print("Hi, welcome to this ride.")
# # query_age = int(input("How old are you ? "))
# # query_height = int(input("How tall are you in inches ? "))
# # if query_age <= 12 and query_height >= ride_height:
# # print("Your ride cost is $6.")
# # elif query_age > 12 and query_age <= 59 and query_height >= ride_height:
# # print("Your ride cost is $12. ")
# # elif query_age > 60 and query_height >= ride_height:
# # print("Your ride cost is $7. ")
# # else:
# # print("Due to your height, this ride may not be appropriate for you.")
#
# # NOTE Buffet
# #
# # There is a buffet my family likes called Tokyo Bay. It charges $15.00 per
# # adult and $10.00 per child. On Tuesdays, though, kids eat free.
# # Write a program to ask the user:
# # 1. How many adults are in their family?
# # 2. How many children are in their family?
# # 3. What day of the week is it?
# # Tell the user how much it will cost for the family to eat at Tokyo Bay.
#
# adult_price = 15
# child_price = 10
#
# print("Hi, welcome to Tokyo Bay. Please answer the following questions so that we can provide you with the best service")
# query_adults = int(input("How many adults are in the your family ?"))
# query_children = int(input("How many children are in their family?"))
# result_one = adult_price*query_adults
# result_two = result_one+(child_price*query_children)
# Sentence0 = "Your total is $"
# Sentence1 = "."
# query_day = input("What day of the week is it ? ")
# if query_day == "Tuesday"or "tuesday"or"TUESDAY":
# print(Sentence0, result_one, Sentence1)
# else:
# print(Sentence0, result_two, Sentence1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment