-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJ04005.java
More file actions
34 lines (25 loc) · 839 Bytes
/
J04005.java
File metadata and controls
34 lines (25 loc) · 839 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
//src/J04005.java
import java.util.Scanner;
public class J04005 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
ThiSinh x = new ThiSinh(sc.nextLine(), sc.nextLine(), sc.nextDouble(), sc.nextDouble(), sc.nextDouble());
System.out.println(x);
}
}
//src/ThiSinh.java
class ThiSinh {
private String hoTen;
private String ngaySinh;
private double d1, d2, d3;
public ThiSinh(String hoTen, String ngaySinh, double d1, double d2, double d3) {
this.hoTen = hoTen;
this.ngaySinh = ngaySinh;
this.d1 = d1;
this.d2 = d2;
this.d3 = d3;
}
public String toString() {
return this.hoTen + " " + this.ngaySinh + " " + String.format("%.1f", this.d1 + this.d2 + this.d3);
}
}