310,709 views
19 votes
19 votes
Write a program to input the TotalCost and display the Assured gift as per the following criteria TotalCost(TC) Assured Gift Less than or up to 2000 Wall Clock 32001 to 5000 School Bag 5001 to 10,000 Electric Iron More than 10,000 Wrist Watch​

User WLGfx
by
2.7k points

1 Answer

13 votes
13 votes

Answer:

The program in Python is as follows:

TotalCost = int(input("Total cost: "))

if TotalCost <= 2000:

print("Wall Clock")

elif TotalCost >= 2001 and TotalCost <= 5000:

print("School Bag")

elif TotalCost >= 5001 and TotalCost <= 10000:

print("Electric Iron")

else:

print("Wrist Watch")

Step-by-step explanation:

This gets input for total cost

TotalCost = int(input("Total cost: "))

If the total cost is up to 2000, print wall clock as the assured gift

if TotalCost <= 2000:

print("Wall Clock")

If the total cost is between 2001 and 5000 (inclusive), print school bag as the assured gift

elif TotalCost >= 2001 and TotalCost <= 5000:

print("School Bag")

If the total cost is between 5001 and 10000 (inclusive), print electric iron as the assured gift

elif TotalCost >= 5001 and TotalCost <= 10000:

print("Electric Iron")

If the total cost is more than 10000, print wrist watch as the assured gift

else:

print("Wrist Watch")

User Iasksillyquestions
by
2.8k points