Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package topica.edu.vn;
- import java.util.Scanner;
- public class SinhVien {
- private String hoTen;
- private int maSV;
- private float diemTB;
- private int n;
- private SinhVien []sv = new SinhVien[2];
- public String getHoTen() {
- return hoTen;
- }
- public void setHoTen(String hoTen) {
- this.hoTen = hoTen;
- }
- public int getMaSV() {
- return maSV;
- }
- public void setMaSV(int maSV) {
- this.maSV = maSV;
- }
- public float getDiemTB() {
- return diemTB;
- }
- public void setDiemTB(float diemTB) {
- this.diemTB = diemTB;
- }
- Scanner nhap = new Scanner(System.in);
- public void nhap()
- {
- for(int i = 0; i < 2; i++)
- {
- System.out.print("nhập họ và tên:");
- hoTen = new Scanner(System.in).nextLine();
- System.out.print("nhập mã sinh viên:");
- maSV = new Scanner(System.in).nextInt();
- System.out.print("nhập điểm trung bình:");
- diemTB = new Scanner(System.in).nextFloat();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement