0
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 ti
Please any one can do it
46 Antworten
+ 32
bill = int(input())
x=20
y=100
tip=(bill*int(x)/int(y))
print(float(tip))
+ 4
bill = int(input())
x=20
y=100
tip=(bill*int(x)/int(y))
print(float(tip))
+ 3
Jolen Mascarenhas ,
as i understand, the code has to be in python?
Billa Chandu ,
no, we will not do it for you!
to get useful help from the community, we need to see your attempt first. without having seen your code, it is difficult to find out where the issue is.
=> please put your code in playground and link it here
thanks!
+ 3
Lauren Baeza ,
you have posted a statement that looks like that you have an issue. it would be better if you create a new post with a question and a description about your problem.
please mention the programming language, the tutorial and the lesson name and number. you should also link your code here.
thanks!
+ 2
I'll give u a start....
Declare 2 variables example a, b
Take the total bill amount from the user n store it in a
Find the percentage 0.2*a and store in b
Print b
That's it
+ 2
bill=int(input())
print (bill*20 / 100)
+ 1
#include <stdio.h>
int main() {
int amt;
float ans;
printf("enter the total amount\n");
scanf("%d", &amt);
ans=0.2*amt;
printf("You have to tip %f",ans);
return 0;
}
+ 1
Oh ...😅
+ 1
I guess that's too simple 😝
+ 1
Hmmm show me Ur program
+ 1
Here is a simple function in python:
https://code.sololearn.com/cByPTugd36u6/?ref=app
+ 1
Using def () may confuse comprehension for Billa Chandu, because he must be a beginner
+ 1
@Varshni Ramdhani ,
please don't post in someone else's thread, please create your own. otherwise you will hardly get an answer.
+ 1
Thanks to allah finally i did it this tip calculater question.
Given
tip = 20% of bill so we dont use any number except this 20% because they need the method not the mathmatical issue. So look at below and give me follow my account name is Mohamed Osman
bill = int(input())
tip = bill * 20/100
print(float(tip))
+ 1
Alright....so I figured out it doesn't actually want you to input the actual numbers in the problem except for the percentage.
Wow. I read that problem over and over. How incredibly confusing and frustrating
+ 1
Q. 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.
answer is
bill = int(input())
x=20
y=100
tip=(bill*int(x)/int(y))
print(float(tip))
for more doubt solving contact on this channel by telegram
https://youtu.be/tOWQqOWieE4
+ 1
bill = int(input())
#your code goes here
tip = bill * 20/100
print(float(tip))
+ 1
bill = int(input())
x=20
y=100
tip=(bill*int(x)/int(y))
print(float(tip))
0
Make amt as float n not int
My bad🤦😅
0
I think first u should give it a try