- 1
Can someone help with this question please.đ
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
3 Answers
+ 2
Where did you stuck?
Did you know how to get user input and save it into a variable?
Did you know basic arithmetic?
Did you know print variables?
Did you know how you calculate with percent?
+ 2
You have described clearly the problem and the solution lies in the last 4 lines.
"Sample Input
50
Sample Output
10.0"
Follow step by step and do the following:
Sample input--> Give an input (It is easy to give input in every commercial language. You have to save the input into a variable.)
Let's assume that your input is the number 50 (as your example, so input=50)
Sample output-->Print the output which is 10 (Why 10? Think, how 50 became 10? Take in mind the 20% which is 0.2.)
In short how does 50 become 10 by using 0.2?
Hope I helped and didn't confuse you.
+ 1
Yes, we can. But we can't guess how.
Edit your question with a link to your attempt in Code Playground and an explanation of your difficulties.