-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayer.java
More file actions
32 lines (29 loc) · 850 Bytes
/
Player.java
File metadata and controls
32 lines (29 loc) · 850 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
package labexam;
public class Player {
private final String Name;
private final int Age;
private final double prize_money_for_single_match;
private double money;
private double total_money=0.0;
public Player(String N,int a,double pm){
Name=N;
Age=a;
prize_money_for_single_match=pm;
}
public double Total_Prize_Money(){
money=prize_money_for_single_match*10;
return money;
}
public void bonus(int a){
if(a>10)
{
total_money=money+1000;
}
}
public void display(){
System.out.println("Name:"+Name);
System.out.println("Age:"+Age);
System.out.println("Prize money for single match:"+prize_money_for_single_match);
System.out.println("Bonus:"+total_money);
}
}