A lot of cell phones have tip calculators. Write one. Ask the user for the price of the meal and the percent tip they want to le | Sololearn: Learn to code for FREE!

0

A lot of cell phones have tip calculators. Write one. Ask the user for the price of the meal and the percent tip they want to le

What the problem in this code? h = int(input('Enter the price of meal : ')) i = int(input('Enter the percent of tip you wana leave : ')) t=(h/i)*100 j = h + t print('Bill of meal : ', h, 'Total bill : ' , j)

5/18/2022 4:56:33 PM

Muhammad Rehan

13 Answers

New Answer

+1

# Hi! You can try this one: h = int(input('Enter the price of meal : ')) i = int(input('Enter the percent of tip you wana leave : ')) t = h * (i/100) j = h + t print('Bill of meal : ', h, 'Total bill : ' , j)

+1

Lisa From what I gather from the topic header. The task is to make a tip calculator. It must ask the user for the price of the meal. And the percentage of tip they want to offer.

+1

Chris Coder The "description" is cut off. I asked because if it is a sololearn task or something, the output strings need to be exact.

+1

Lisa my output is not accurate. My code doesn't calculate the percentage of tip.

+1

Muhammad Rehan your tip equation is wrong. it should be: t=h*i/100 are you sure Per Bratthammar 's code is not working? it looks ok to me. Maybe you got the tip and price mixed up in your input?

+1

Muhammad Rehan what error are you getting? If you corrected the tip calculation, in Sololearn you input like this: first line is price, second line is tip. 10 5 submit it should give you the result 10.5

0

What is the task? Please provide the complete description with example input and output.

0

Lisa I see thanks. Understood.

0

محتاج كود رسم مربع برنامج تيربو بس يكون الناتج مال الرسم ملون

0

Lisa its not a solo learn task.

0

Per Bratthammar not working your code

0

Bob_Li Per Bratthammar code give error

0