Question: Complete the following programs using Python. 1 The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such

Complete the following programs using Python.

1 The cost of renting a room at a hotel is, say $100.00 per night. For special occasions, such as a wedding or conference, the hotel offers a special discount as follows: if the number of rooms booked is at least 10, the discount is 10%; at least 20, the discount is 20%; and at least 30, the discount is 30%. Also, if rooms are booked for at least 3 days, then there is an additional 5% discount. Write a program that prompts the user to enter the cost of renting one room, the number of rooms booked, the number of days the rooms are booked, and the sales tax (as a percent). Assume sales tax is applied to the total bill before any discounts have been taken out.

The program outputs:

the cost of renting one room,

the discount on each room as a percent,

the number of rooms booked,

the number of days the rooms are booked,

the total cost of the rooms, the sales tax,

and the total billing amount.

Thoroughly test your code. Here is a sample test case:

Test case 1:

INPUT: Cost to rent one room: 100

The number of rooms: 3

The number of days the rooms are booked: 5

Sales tax: 13

OUTPUT:

The cost of renting one room is $100

The discount for each room is 5%

You have booked 3 rooms

You stay with us for 5 days

The total cost of the rooms before discount is $1500

The sales tax is $195 Please pay the total billing amount of $1620 Test case 2

: INPUT:

Cost to rent one room: 100

The number of rooms: 10

The number of days the rooms are booked: 2

Sales tax: 13

OUTPUT:

The cost of renting one room is $100

The discount for each room is 10%

You have booked 10 rooms

You stay with us for 2 days

The total cost of the rooms before discount is $2000

The sales tax is $260

Please pay the total billing amount of $2060

2.Your program must contain several comment lines with the following information: Your name: Course number and course section: Date of completion: Brief explanation of the program:

3. Write a program that calculates the total amount of a meal purchased at a restaurant. The program should ask the user to enter the charge for the food, and then calculate the amount of a 18 percent tip and 7 percent sales tax. Display each of these amounts and the total. Make sure to display the tip and sales tax with only two decimal places. (HINT: Use the format() function.) Choose descriptive variable names. Make sure to display all data (both what is input to the program and what the program calculates). Clearly explain the output. Dont just display a value.

4.- Ask the user for his or her weight in pounds and output the equivalent weight in kilograms, grams, and milligrams. Make sure to display all data (both what is input to the program and what the program calculates). Clearly explain the output. Dont just display a value. NOTE: 1 pound = 0.453592 kilogram. One kilogram is 1,000 grams and 1,000,000 milligrams. We need the output written with 2 digits after the decimal point. For example, if a person weighs 150 pounds, then the corresponding weight will be: 68.04 kilograms, 68038.80 grams and 68038800.00 milligrams.

III Write a program that asks the user to enter a person's age. The program should display a message indicating whether the person is an infant, a child, a teenager, or an adult. You must use if...elif...else statement. If a person is 1 year old or less, he or she is an infant. If a person is older than 1 year but younger than 13 years, he or she is a child. If a person is older than 13 year but less than 20 years old, he or she is a teenager. If the person is at least 20 years old, he or she is an adult.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!