Intro to Computing
Intro to Computing CS 1301
Popular in Course
Popular in ComputerScienence
This 0 page Class Notes was uploaded by Alayna Veum on Monday November 2, 2015. The Class Notes belongs to CS 1301 at Georgia Institute of Technology - Main Campus taught by Jay Summet in Fall. Since its upload, it has received 22 views. For similar materials see /class/234031/cs-1301-georgia-institute-of-technology-main-campus in ComputerScienence at Georgia Institute of Technology - Main Campus.
Reviews for Intro to Computing
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 11/02/15
CS 1301 Pair Homework 2 ConversionsTip Calculator Due Friday Sep 10 before 6 PM Out of 100 points Files to submit 1 hw2py You will be writing several functions but they will all be saved in one file hw2py Please save all of the functions in this one file or you will lose points This is a pair programming problem You are expected to work with the person you have been pared with in class and you are both responsible for submitting the exact same code to T Square Your pair may collaborate with other students in this class Collaboration means talking through problems assisting with debugging explaining a concept etc You should not exchange code or write code for other pairs Collaboration at a reasonable level will not result in substantially similar code For pair programming assignments you and your partner should turn in identical assignments For Help TA Helpdesk Schedule posted on class website Email TAs Notes Don39t forget to include the required comments and collaboration statement as outlined on the course syllabus 0 Do not wait until the last minute to do this assignment in case you run into problems 0 If you nd a signi cant error in the homework assignment please let a TA know immediately Part 1 Conversions 45 pts Section A Mass 15 pt 5 For part A you will write a function called mass which takes in a value in kilograms and coverts that value into stones For reference there are 0157 stones yes that39s a real unit in 1 kilogram Please return the value Save this function in your hw2py file as well Sample Output gtgtgt mass4 0628 gtgtgt mass8 1256 Section B Volume 15 pts In this section you will need to convert volumes There are 211 US pints in one liter Write a function called volume that takes in a value in liters and converts it to US pints Since we want to know what we re dealing with print the value out with a nice little sentence explaining the conversion thatjust happened Please print the values to 2 decimal places See the sample output below Save this function in your hw2py le as well Sample Output gtgtgt volume1 There are 211 US pints in 100 liters gtgtgt volume4 There are 844 US pints in 400 liters Section C Monkeys 15 pts Just like the previous two problems it s conversion time One average spider monkey is equal to 3762533333333 hockey pucks Seriously Write a function called monkeysO that takes in a number of monkeys and prints out the resultant conversion into hockey pucks Please round the number of hockey pucks to 4 decimal places See the sample output for more clarification Save this function in your hw2py file as well Sample Output gtgtgtmonkeys3 There are 1128760 hockey pucks in 3000000 average spider monkeys gtgtgt monkeys1157 There are 4353251 hockey pucks in 11570000 average spider monkeys Source for the conversion factor httpwwwweirdconve1tercom You should totally go there and play around with conversions that don39t make any sense Impress your professors Entertain your friends Dazzle your family Part 2 It s Math Time 55 points So you ve been up all night playing Rock BandTM with your friends Well rocking out hardcore always makes one tired so you decide to go grab some food It being nearly 3 am the only place is the great institution of Waf e House However you re spent from a night of constant awesomeness and realize you just won t be able to compute the appropriate tip amount for the waitress in your head For some reason though the part of your brain that writes Python functions is super focused and ready to go so you decide to whip out your laptop and write a Python program to handle the tip calculations for you Yes you brought your laptop to Waf e Hours with you You are a Tech student after all You program will also need to be able to handle tax Write a function called tipCalculator that prompts the user for the bill amount and the percent that they want to leave for the tip Do not include the dollar sign or percent sign when entering the numbers Calculate the taX always 78 the tip percent of bill amount excluding tax and the total bill Remember to divide the percentages by 100 when multiplying Here it is important to remember how Python handles division You are expected to round the your tip to the next dollar by use of the mathcei function Basically mathceil always rounds the number up to the next integer Do not forget to import math when using functions from the math module C S 13 01 Individual Homework 1 Python Practice amp Face Due Friday September 3rd before 6 PM Out of 100 points Files to submit 1 HW 1py 2 facepy This is an INDIVIDUAL assignment Collaboration at a reasonable level will not result in substantially similar code Students may only collaborate with fellow students currently taking CS 1301 the TA s and the lecturer Collaboration means talking through problems assisting with debugging explaining a concept etc You should not exchange code or write code for others For Help TA Helpdesk 7 Schedule posted on class website Email TA s or use TSquare Forums Notes Don t forget to include the required comments and collaboration statement as outlined on the course syllabus Do not wait until the last minute to do this assignment in case you run into problems Part 1 Simple Functions You will write a few python functions for practice with the language In your HWlpy file include a comment at the top with your name section GTIDEmail and your collaboration statement Also include each of the following functions 1 kilometersToMiles 2 sphereVolume 3 timeCleanUp 4 bodyMassIndeX Function Name kilometersToMiles Parameters None Return Value None Description 1 Write a userinteractive function to convert kilometers to miles 2 Get the number of kilometers from the user make sure to use a descriptive prompt so the user knows what to enter e g Enter number of kilometers You may assume that the user will enter a valid oat eg 344 and do not have to do error checking 3 Convert the number entered by the user to miles using the fact that 1 mile 1609344 kilometers 4 Print the calculated number of miles be sure to add a label to the display value so the user knows what the value means e g display 35 miles instead of just 35 Function Name sphereVolume Parameters None Return Value None Description Write a userinteractive function to calculate the volume of a sphere 1 Get the length of the radius in inches from the user make sure to use a descriptive prompt so the user knows what to enter 2 Calculate the volume of a sphere with the radius entered by the user note the volume ofa sphere is calculated using the formula V 4 3 pi rquot note Python has a builtin constant variable for pi named mathpi you will have to import math before you use this constant 3 Print the calculated volume be sure to add a label to display value so the user knows what the value means eg display Volume of the sphere is 35 inches cubed instead of just 35 Function Name timeCleanUp Parameters None Return Value None Description Write a userinteractive function to convert seconds to the equivalent number of hours minutes and seconds 1 Get the number of seconds as an integer from the user make sure to use a descriptive prompt so the user knows what to enter 2 Calculate the total number of hours minutes and seconds represented by the original number of seconds answered using the following hints There are 60 seconds in a minute There are 60 minutes in an hour The mod aka remainder operator in python is and will show the remainder left after an integer division It IS useful for this problem E Print the calculated number of hours minutes and seconds on one line be sure to add appropriate labels to the display values so the user knows what the value means eg display 5 hours 2 minutes 33 seconds Funetlon Name hm lyMzssIndzx Parameters Nnne Return Value Nnne Desenpuon RW h d m wd the user knows what to enter 2 Ask for the person39s helghtln lnehes agam use a olesenptlye prompt 3 39 BMI below you wlll neeolto eonyert the formulalnto alegal python equauon weigh lb gtlt 703 BMI heighzzonz 4 Punt the result The value mustbe formatted both the Wordmg andthe number of deelmal plaees EXACTLY as follows Your BMIls 24 9 quot where the value for 6 BMI represents whatever you ealeulateol based on the lnputs Yuu may use smngfmmatzmg to remove 2x011 desrmul placesmm yam sulsuluuuu Graphics Intro o you39re sltung there lookmg at your Python wlnolow anol you nd lt to be well lmpersonal So why olon39twe aolol allttle personallty to lt7How about afaeel m programming your robot and making graphics See the documentation here httpwiki 39 J im org Mvroi f iManual For this assignment we will be focusing on the graphics aspect of myro so you won t need your robot Both the link given above as well as the PDF for the Myro Graphics Reference will be rather helpful Part 2 Making the Face 50 Points Files to submit facapy Your mission should you choose to accept it and we recommend that you do is to make a face in Python You need to create a program that initializes a graphics window and draws the face When you are done save your program as facepy Make sure that your filename matches this exactly 01 you will lose points Don t forget to include any necessary import statements needed to use myro functions The face should contain 0 A Head 0 2 Eyes 0 A Nose 0 A mouth 0 At least 2 different colors Try to keep things in a general face alignment here Sorry to all you budding Picassos out there but the shapes can be whatever you want Be creative Grading Rubric Grading You will earn points as follows for each function that works correctly according to the specifications Simple Function 50 points total kilometersToMiles 5 sphereVolume 10 timeCleanup 20
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'