-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathch13.java
More file actions
44 lines (31 loc) · 941 Bytes
/
ch13.java
File metadata and controls
44 lines (31 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package chMoney13;
import java.util.Scanner;
public class ch13
{
public static void main(String args[])
{
int karaGlassCount;
int raniGlassCount;
int karaGlassRate=5;
int raniGlassRate=7;
Scanner in=new Scanner(System.in);
System.out.println(" Enter kara's glass count : ");
karaGlassCount=in.nextInt();
System.out.println(" Enter rani's glass count : ");
raniGlassCount=in.nextInt();
int karaTotalMoney=karaGlassCount*karaGlassRate;
int raniTotalMoney=raniGlassCount*raniGlassRate;
if(karaTotalMoney>raniTotalMoney)
{
System.out.println(" Kara : "+karaTotalMoney+" cents ");
}
else if (raniTotalMoney>karaTotalMoney)
{
System.out.println(" Rani : "+raniTotalMoney+" cents ");
}
else if (karaTotalMoney==raniTotalMoney)
{
System.out.println(" Kara and Rani both cents equal money");
}
}
}