Skip to content

Commit 04de32d

Browse files
committedOct 7, 2021
CE
1 parent ad8d41b commit 04de32d

File tree

10 files changed

+251
-0
lines changed

10 files changed

+251
-0
lines changed
 

Diff for: ‎CodePtit/pom.xml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.mycompany</groupId>
5+
<artifactId>CodePtit</artifactId>
6+
<version>1.0-SNAPSHOT</version>
7+
<packaging>jar</packaging>
8+
<properties>
9+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
10+
<maven.compiler.source>16</maven.compiler.source>
11+
<maven.compiler.target>16</maven.compiler.target>
12+
</properties>
13+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package DS_DoiTuongSinhVien_1;
7+
8+
/**
9+
*
10+
* @author Admin
11+
*/
12+
import java.util.*;
13+
import java.text.SimpleDateFormat;
14+
15+
public class DS_DoiTuongSinhVien_1 {
16+
17+
private int ma;
18+
private String ten, mcls, ngSinh;
19+
private float gpa;
20+
21+
public DS_DoiTuongSinhVien_1(int ma, String ten, String mcls, String ngSinh, float gpa) {
22+
this.ma = ma;
23+
this.ten = ten;
24+
this.mcls = mcls;
25+
this.ngSinh = ngSinh;
26+
this.gpa = gpa;
27+
}
28+
29+
public String FormatMA(int ma) {
30+
String res = "B20DCCN00" + String.valueOf(ma);
31+
return res;
32+
}
33+
34+
public String FormatNGSINH(String ngSinh) {
35+
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
36+
try {
37+
Date date = formatter.parse(ngSinh);
38+
SimpleDateFormat formatter1 = new SimpleDateFormat("dd/MM/yyyy");
39+
String d = formatter1.format(date);
40+
return d;
41+
} catch (Exception e) {
42+
e.printStackTrace();
43+
}
44+
return null;
45+
}
46+
47+
public void thongBao() {
48+
String res = FormatMA(ma) + " " + ten + " " + mcls + " " + FormatNGSINH(ngSinh) + " " + String.valueOf(gpa);
49+
System.out.println(res);
50+
}
51+
}
Binary file not shown.
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package DS_DoiTuongSinhVien_1;
7+
8+
import java.util.Scanner;
9+
10+
/**
11+
*
12+
* @author Admin
13+
*/
14+
public class KhaiBao {
15+
public static void main(String[] args) {
16+
Scanner sc = new Scanner(System.in);
17+
int t = Integer.parseInt(sc.nextLine());
18+
String ten = sc.nextLine();
19+
String mcls = sc.nextLine();
20+
String ngSinh = sc.nextLine();
21+
Float gpa = Float.parseFloat(sc.nextLine());
22+
DS_DoiTuongSinhVien_1 sv = new DS_DoiTuongSinhVien_1(t,ten,mcls,ngSinh,gpa);
23+
sv.thongBao();
24+
}
25+
}

Diff for: ‎CodePtit/src/main/java/KhaiBaoDoiTuong/KhaiBao.java

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package KhaiBaoDoiTuong;
7+
8+
/**
9+
*
10+
* @author Admin
11+
*/
12+
import java.util.*;
13+
14+
public class KhaiBao {
15+
16+
public static void main(String[] args) {
17+
Scanner sc = new Scanner(System.in);
18+
String ma = sc.nextLine();
19+
String ten = sc.nextLine();
20+
float toan = sc.nextFloat();
21+
float ly = sc.nextFloat();
22+
float hoa = sc.nextFloat();
23+
TuyenSinh ts = new TuyenSinh(ma,ten,toan,ly,hoa);
24+
ts.thongBao();
25+
}
26+
}
1.21 KB
Binary file not shown.
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package KhaiBaoDoiTuong;
7+
8+
/**
9+
*
10+
* @author Admin
11+
*/
12+
public class TuyenSinh {
13+
// tạo thuộc tính cho lớp
14+
private String ma,ten;
15+
private float toan,ly, hoa;
16+
// Contructor được dùng để khởi tạo đối tượng.
17+
public TuyenSinh(String ma,String ten,float toan, float ly, float hoa) {
18+
this.ma = ma;
19+
this.ten = ten;
20+
this.toan = toan;
21+
this.ly = ly;
22+
this.hoa = hoa;
23+
}
24+
public float tinhTong(float toan,float ly,float hoa){ //method tinh tong
25+
float sm = toan*2+ly+hoa;
26+
return sm;
27+
}
28+
public float uuTien(String ma){ // method tinh uu tien
29+
if(ma.charAt(2) == '1'){
30+
return (float) 0.5;
31+
}
32+
else if(ma.charAt(2) == '2'){
33+
return (float) 1.0;
34+
}
35+
else{
36+
return (float) 2.5;
37+
}
38+
}
39+
public String ketQua(){ // method ket luan
40+
float diem = tinhTong(toan, ly, hoa) + uuTien(ma);
41+
if(diem >= 24){
42+
return "TRUNG TUYEN";
43+
}
44+
else{
45+
return "TRUOT";
46+
}
47+
}
48+
public void thongBao(){
49+
String r = String.valueOf(tinhTong(toan, ly, hoa));
50+
String r_1,u_1;
51+
int k = r.indexOf('.');
52+
if(r.charAt(k+1) == '0'){
53+
r_1 = r.replace(".0", "");
54+
}
55+
else{
56+
r_1 = r;
57+
}
58+
String u = String.valueOf(uuTien(ma));
59+
int k_1 = u.indexOf('.');
60+
if(u.charAt(k_1+1) == '0'){
61+
u_1 = u.replace(".0", "");
62+
}
63+
else{
64+
u_1 = u;
65+
}
66+
String res = ma + " " + ten + " " + u_1 + " " + r_1 + " "+ ketQua();
67+
System.out.println(res);
68+
}
69+
70+
}

Diff for: ‎CodePtit/src/main/java/TinhToanPhanSo/KhaiBao.java

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package TinhToanPhanSo;
7+
8+
/**
9+
*
10+
* @author Admin
11+
*/
12+
import java.util.*;
13+
public class KhaiBao {
14+
public static void main(String[] args) {
15+
Scanner sc = new Scanner(System.in);
16+
int t = Integer.parseInt(sc.nextLine());
17+
while(t-->0){
18+
int tu_1 = sc.nextInt();
19+
int mau_1 = sc.nextInt();
20+
int tu_2 = sc.nextInt();
21+
int mau_2 = sc.nextInt();
22+
23+
}
24+
}
25+
}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package TinhToanPhanSo;
7+
8+
/**
9+
*
10+
* @author Admin
11+
*/
12+
import java.util.*;
13+
public class TinhToanPhanSo {
14+
// thuộc tính của phân số
15+
private int tu_1,mau_1,tu_2,mau_2;
16+
public TinhToanPhanSo(int tu_1,int mau_1,int tu_2,int mau_2){
17+
this.tu_1 = tu_1;
18+
this.mau_1 = mau_1;
19+
this.mau_2 = mau_2;
20+
this.tu_2 = tu_2;
21+
this.mau_2 = mau_2;
22+
}
23+
public void tinhToan(){
24+
25+
}
26+
private gcd(int tu_1)
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* To change this license header, choose License Headers in Project Properties.
3+
* To change this template file, choose Tools | Templates
4+
* and open the template in the editor.
5+
*/
6+
package com.mycompany.set_map.Basic_programming;
7+
8+
/**
9+
*
10+
* @author Admin
11+
*/
12+
public class BaiToanTuyenSinh {
13+
14+
}

0 commit comments

Comments
 (0)
Please sign in to comment.