We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 765ad9b commit c9ff319Copy full SHA for c9ff319
01Day1/Task/Solution1.java
@@ -1,14 +1,19 @@
1
+import java.util.Scanner;
2
+
3
public class Arithmetic {
4
5
public static void main(String[] args)
6
{
- double mealcost=12.00;
- int tipPercent=20;
- int taxPercent=8;
7
+ Scanner scan=new Scanner(Systen.in);
8
+ double mealcost=scan.nextDouble(); //orignal mealcost
9
+ int tipPercent=scan.nexInt(); //tip percent
10
+ int taxPercent=scan.nextInt(); //tax percent
11
12
+ //Calculations for bill amount
13
double tip=((mealcost*tipPercent)/100);
14
double tax=((mealcost*taxPercent)/100);
- int totalcost=tip+tax+mealcost;
- System.out.print(totalcost);
15
+ int totalcost=(int) (tip+tax+mealcost) ;
16
+ System.out.println("Your total bill is of:"+totalcost);
17
}
18
19
0 commit comments