Mar-17-2018, 04:21 AM
So I am stuck on number 2 right now but if someone could help guide me it would be very appreciated. I cant figure out how to use an "if" statement with two variables. Im on python 3.6.
2) At the local sports store, footballs are priced at $30 each if fewer than six are purchased, $28 each if at least six but fewer than twelve are purchased, and $26 each if at least twelve are purchased. Write a program that accepts the input from the user of how many footballs he/she would like to purchase, and outputs the cost.
3) A company pays an employee $5 per hour if she works 40 hours or less. If she works more than 40 hours, she gets $9 per hour for each extra hour. Write a program that accepts the input being the number of hours worked (assume an integer), and outputs the employees pay.
2) At the local sports store, footballs are priced at $30 each if fewer than six are purchased, $28 each if at least six but fewer than twelve are purchased, and $26 each if at least twelve are purchased. Write a program that accepts the input from the user of how many footballs he/she would like to purchase, and outputs the cost.
3) A company pays an employee $5 per hour if she works 40 hours or less. If she works more than 40 hours, she gets $9 per hour for each extra hour. Write a program that accepts the input being the number of hours worked (assume an integer), and outputs the employees pay.