Advertisement
Guest User

Untitled

a guest
Aug 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. package topica.edu.vn;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class SinhVien {
  6.  
  7. private String hoTen;
  8. private int maSV;
  9. private float diemTB;
  10. private int n;
  11. private SinhVien []sv = new SinhVien[2];
  12.  
  13. public String getHoTen() {
  14. return hoTen;
  15. }
  16.  
  17. public void setHoTen(String hoTen) {
  18. this.hoTen = hoTen;
  19. }
  20.  
  21. public int getMaSV() {
  22. return maSV;
  23. }
  24.  
  25. public void setMaSV(int maSV) {
  26. this.maSV = maSV;
  27. }
  28.  
  29. public float getDiemTB() {
  30. return diemTB;
  31. }
  32.  
  33. public void setDiemTB(float diemTB) {
  34. this.diemTB = diemTB;
  35. }
  36.  
  37. Scanner nhap = new Scanner(System.in);
  38.  
  39.  
  40. public void nhap()
  41. {
  42. for(int i = 0; i < 2; i++)
  43. {
  44. System.out.print("nhập họ và tên:");
  45. hoTen = new Scanner(System.in).nextLine();
  46. System.out.print("nhập mã sinh viên:");
  47. maSV = new Scanner(System.in).nextInt();
  48. System.out.print("nhập điểm trung bình:");
  49. diemTB = new Scanner(System.in).nextFloat();
  50.  
  51. }
  52. }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement