🔴Help plZ🔴 | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
- 3

🔴Help plZ🔴

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. Input =50

20th Nov 2021, 9:14 PM
FARID FATHI
FARID FATHI - avatar
15 Antworten
+ 9
Just remove the line bill = 50 from your code
20th Nov 2021, 9:32 PM
Lisa
Lisa - avatar
+ 1
* get input * convert input to numeric data type * multiply by 20/100 * output Link your code please!1
20th Nov 2021, 9:16 PM
Lisa
Lisa - avatar
+ 1
Why are you setting bill = 50? bill should be the user input!
20th Nov 2021, 9:27 PM
Lisa
Lisa - avatar
0
bill = int(input()) y = 20/100 bill =50 print (bill * float(y)) Is it wrong ?
20th Nov 2021, 9:22 PM
FARID FATHI
FARID FATHI - avatar
0
bill = int(input()) y = 20/100 bill =50 print(float(bill * (y))) Or this ?
20th Nov 2021, 9:24 PM
FARID FATHI
FARID FATHI - avatar
0
Thx i got it bill = int(input()) y = 20/100 print(float(bill * (y)))
20th Nov 2021, 9:31 PM
FARID FATHI
FARID FATHI - avatar
0
Yes right
20th Nov 2021, 9:32 PM
FARID FATHI
FARID FATHI - avatar
0
Bill=float(input()) Print(.2*Bill)
22nd Nov 2021, 6:33 AM
Soheil Sa
Soheil Sa - avatar
0
use float bill=float(bill)
22nd Nov 2021, 7:30 AM
Hexagon
- 1
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
20th Nov 2021, 9:27 PM
FARID FATHI
FARID FATHI - avatar
- 1
50 is only an example – the user could input any other number
20th Nov 2021, 9:28 PM
Lisa
Lisa - avatar
- 1
Thx lisa
20th Nov 2021, 9:29 PM
FARID FATHI
FARID FATHI - avatar
- 1
So what’s the exactly code ?
20th Nov 2021, 9:30 PM
FARID FATHI
FARID FATHI - avatar
- 1
bill_amount = int(input()) tip = 0.2 * bill_amount print(tip)
21st Nov 2021, 2:35 PM
hamsika krishnan
hamsika krishnan - avatar
- 3
int main(){ int bill; scanf("%d", &bill); float tip = bill * 02; printf("%.2f", tip); } Change that to python
20th Nov 2021, 9:25 PM
William Owens
William Owens - avatar