0

I need your help here

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

7th Jan 2022, 9:50 AM
Agbofa Victor
Agbofa Victor - avatar
8 Réponses
+ 3
Agbofa Victor please show your own code attempt instead of letting other do the work
7th Jan 2022, 10:02 AM
Lisa
Lisa - avatar
+ 2
The formula : input / 5 = output, try to think about the code, but if you need more help, just tell
7th Jan 2022, 9:54 AM
VCoder
VCoder - avatar
+ 1
Kindly write the full code for the question
7th Jan 2022, 9:59 AM
Agbofa Victor
Agbofa Victor - avatar
+ 1
In which language ?
7th Jan 2022, 10:01 AM
VCoder
VCoder - avatar
7th Jan 2022, 10:01 AM
Agbofa Victor
Agbofa Victor - avatar
+ 1
amount = int(input) print(amount / 5) #same as amount * 20 / 100
7th Jan 2022, 10:02 AM
VCoder
VCoder - avatar
0
Ok I will do that right away
7th Jan 2022, 10:03 AM
Agbofa Victor
Agbofa Victor - avatar
0
This is in java. Run in java complier and see import java.util.*; class HelloWorld {     public static void main(String[] args) {         System.out.println("enter the amount of bill paid");          Scanner sc = new Scanner(System.in);         int bill = sc.nextInt();         float tip = bill/5;         System.out.println(tip);     } }
8th Jan 2022, 6:56 PM
Sonali Kala
Sonali Kala - avatar