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
8 Réponses
+ 3
Agbofa Victor please show your own code attempt instead of letting other do the work
+ 2
The formula : input / 5 = output, try to think about the code, but if you need more help, just tell
+ 1
Kindly write the full code for the question
+ 1
In which language ?
+ 1
+ 1
amount = int(input)
print(amount / 5) #same as amount * 20 / 100
0
Ok I will do that right away
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);
}
}