Skip to content

Feature qlsv save txt - #10

Open
daboard wants to merge 11 commits into
developfrom
feature-QLSV-saveTxt
Open

Feature qlsv save txt#10
daboard wants to merge 11 commits into
developfrom
feature-QLSV-saveTxt

Conversation

@daboard

@daboard daboard commented Feb 10, 2020

Copy link
Copy Markdown
Collaborator

save txt to develop

System.out.println("Nhập địa chỉ:");
diaChi = keyboard.nextLine();
System.out.println("Nhập tuổi:");
tuoi = keyboard.nextInt();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dùng keyboard.nextLine(), để tránh bị lỗi như a post ảnh

System.out.println("Nhập số chứng minh thư");
soCmt = keyboard.nextInt();
System.out.println("Nhập số điểm Ielts");
diemIelts = keyboard.nextFloat();

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tương tự như nhập tuổi, nhập bằng string, và sau đó parse sang double

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nói chung tất cả đều dùng string và sau đó parse sang kiểu dữ liệu tương ứng

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Integer.parseInt(keyboard.nextLine()); thay cho keyboard.nextInt() va tuong tu cho cac field khac phai khong a?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

đúng rồi

int tuoi;
int soCmt;
float diemIelts;
Scanner keyboard = new Scanner(System.in);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thay vì tạo mới đối tượng keyboard, thì e dùng đối tượng đã được tạo, làm tham số truyền vào cho hàm này

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em vừa fix lại rồi ạ.

System.out.println("Bạn có muốn thực hiện lại không? Yes/ No?");
repeat = keyboard.nextLine();

} while (repeat.equals("Yes") == true);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

không cần check == true nữa

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em fix rồi ạ

}
}

private static void editSinhVien() {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit xong chưa save vào txt file

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

em add saveData() vào rồi ạ.


}

int sizes = 0;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

biến này không dùng

}

int sizes = 0;
private static Scanner x;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nên để trong hàm, vì cái này chỉ phục vụ hàm dưới, nên ko cần để phạm vi bên ngoài. đặt tên có nghĩa

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

em fix lại rồi ạ

}

// Check an element is null or not
private static boolean isNotNull(SinhVien x) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

có thể ngắn gọn dòng code return sv == null ? false : true;
đặt tên biến có nghĩa

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vâng ạ


// Check an element is null or not
private static boolean isNotNull(SinhVien x) {
return x == null ? false : true;

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename x for meaning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants