Question: A store sells all items for $1. Customers buying 10 or more items receive a 5% discount. Additionally, there is 7.5% sales tax. a)
A store sells all items for $1. Customers buying 10 or more items receive a 5% discount. Additionally, there is 7.5% sales tax. a) Write a program that prompts the user for the number of items purchased and calculates the total cost before and after tax. Here is an example run: Enter number of items: 11 Gross cost: 11.0 Discount: 0.55 Net cost: 10.45 Tax: After tax: 0.78 11.23 Write a program that prompts the user for their height (in inches) and weight (in pounds). The program should calculate BMI and then display one of three messages: the user is within the healthy BMI range (if their BMI is between 18.5 and 24.9) the number of pounds needed to lose in order to be at the top of the healthy BMI range (if their BMI is above 24.9) the number of pounds needed to gain in order to be at the bottom of the healthy range (if their BMI is below 18.5) Here is an example run: Enter your height: 68 Enter your weight: 165 Weight to lose for healthy BMI: 7 pounds An intercampus shuttle can take one of two routes. For each run, a dispatcher checks what the current traffic conditions are to find out the average speed on each route and determine which route the shuttle driver should take. Write a program that: prompts for four inputs: route 1's distance in miles and speed in miles per hour as well as route 2's distance and speed. calculates the time each route would take determines and displays which route is faster and how long it will take in minutes A store sells items priced according to the following table: # of items 1-19 20-49 50-99 100 or more Cost per item $4.75 $4.50 $4.25 $4.00 For example, an order for 25 items would cost (25 x $4.50) = $112.50 Write a program that takes as input the number of items, determines the cost per item, and displays the cost per item and total order cost. US federal income tax is based on a schedule of tax rates depending on income. For example, for those with a filing status of single, the following table applies: Income Up to $9,875 $9,876-$40,125 $40,126-$85,525 Income Tax 10% of income $986 +12% of income over $9,875 $518,401 or more $4,618 + 22% of income over $40,125 $85,526-$163,300 $14,606 + 24% of income over $85,525 $163,301-$207,350 $33,272 + 32% of income over $163,300 $207,351-$518,400 $47,368 + 35% of income over $207,350 $156,235 +37% of income over $518,400 The marginal tax rates are the percentages in the table above. The effective tax rate is the income tax divided by the income. Write a program that prompts for income and calculates and displays the marginal tax rate, effective tax rate, and income tax. A hotel charges a standard rate of $100 per night. For platinum members (customers who have previously stayed 20 nights or more), the hotel offers a discounted price of $90 per night. Also, for platinum members staying 5 or more nights, 1 night is free. For example, a platinum member staying 5 nights would be charged $90 for 4 nights ($360). Write a program that prompts the user for the number of nights for their stay and whether they are a platinum status member and then determines the cost for their stay. Also, if they are a platinum member and their stay is 5 or more nights, indicate this in a note. Additionally, if the customer is not a platinum member and their stay was 3 or more nights, display a note asking them to consider becoming a platinum member. Here is an example run: # of nights: 5 Platinum member (y/n)? y Charge = $ 360 Note: charges discounted for one free night A store sells all items for $1. Customers buying 10 or more items receive a 5% discount. Additionally, there is 7.5% sales tax. a) Write a program that prompts the user for the number of items purchased and calculates the total cost before and after tax. Here is an example run: Enter number of items: 11 Gross cost: 11.0 Discount: 0.55 Net cost: 10.45 Tax: After tax: 0.78 11.23 Write a program that prompts the user for their height (in inches) and weight (in pounds). The program should calculate BMI and then display one of three messages: the user is within the healthy BMI range (if their BMI is between 18.5 and 24.9) the number of pounds needed to lose in order to be at the top of the healthy BMI range (if their BMI is above 24.9) the number of pounds needed to gain in order to be at the bottom of the healthy range (if their BMI is below 18.5) Here is an example run: Enter your height: 68 Enter your weight: 165 Weight to lose for healthy BMI: 7 pounds An intercampus shuttle can take one of two routes. For each run, a dispatcher checks what the current traffic conditions are to find out the average speed on each route and determine which route the shuttle driver should take. Write a program that: prompts for four inputs: route 1's distance in miles and speed in miles per hour as well as route 2's distance and speed. calculates the time each route would take determines and displays which route is faster and how long it will take in minutes A store sells items priced according to the following table: # of items 1-19 20-49 50-99 100 or more Cost per item $4.75 $4.50 $4.25 $4.00 For example, an order for 25 items would cost (25 x $4.50) = $112.50 Write a program that takes as input the number of items, determines the cost per item, and displays the cost per item and total order cost. US federal income tax is based on a schedule of tax rates depending on income. For example, for those with a filing status of single, the following table applies: Income Up to $9,875 $9,876-$40,125 Income Tax 10% of income $986 +12% of income over $9,875 $40,126-$85,525 $4,618 + 22% of income over $40,125 $85,526-$163,300 $14,606 +24% of income over $85,525 $518,401 or more $163,301-$207,350 $33,272 + 32% of income over $163,300 $207,351-$518,400 $47,368 + 35% of income over $207,350 $156,235 +37% of income over $518,400 The marginal tax rates are the percentages in the table above. The effective tax rate is the income tax divided by the income. Write a program that prompts for income and calculates and displays the marginal tax rate, effective tax rate, and income tax. A hotel charges a standard rate of $100 per night. For platinum members (customers who have previously stayed 20 nights or more), the hotel offers a discounted price of $90 per night. Also, for platinum members staying 5 or more nights, 1 night is free. For example, a platinum member staying 5 nights would be charged $90 for 4 nights ($360). Write a program that prompts the user for the number of nights for their stay and whether they are a platinum status member and then determines the cost for their stay. Also, if they are a platinum member and their stay is 5 or more nights, indicate this in a note. Additionally, if the customer is not a platinum member and their stay was 3 or more nights, display a note asking them to consider becoming a platinum member. Here is an example run: # of nights: 5 Platinum member (y/n)? y Charge = $ 360 Note: charges discounted for one free night
Step by Step Solution
3.40 Rating (156 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
