+ 1
How to solve this friends bill amount is 100 but I should give 20% tip as a float please help me on the same
When you go out to eat, you always tip 20% of the bill amount. But who’s got the time to calculate the right tip amount every time? Not you that’s for sure! You’re making a program to calculate tips and save some time. Your program needs to take the bill amount as input and output the tip as a float. Sample Input 50 Sample Output 10.0
5 Respuestas
+ 2
First try yourself. In case you face any problem post the code with your question.
All the best
+ 1
Ok bro I tried many times will try again
+ 1
tip is 20% == 1/5 == 0.2
bill is 100%==1
0
it will be a piece of cake if you know about percentages
0
The formula for calculating the tip is given in the explanation. All you have to do is get the bill as input, calculate the tip using the formula and print it.