Câu hỏi 664354 - Kỹ thuật lập trình hướng đối tượng - IT07 Đâu là đoạn mã xây dựng lớp HocSinh theo sơ đồ sau: Chọn đáp án: class HocSinh extend NhanSu{float diemTB;void nhapHS( ){NhanSu.nhapNS();Scanner sc = new Scanner(System.in);System.out.print(“Nhap DTB:”);diemTB = sc.nextFloat( );}void xuatHS( ){NhanSu.xuatNS();System.out.printf(“%7.1f”, diemTB);}} class HocSinh extends NhanSu{float diemTB;void nhapHS( ){super.nhapNS();Scanner sc = new Scanner(System.in);System.out.print(“Nhap DTB:”);diemTB = sc.nextFloat( );}void xuatHS( ){super.xuatNS();System.out.printf(“%7.1f”, diemTB);}} class HocSinh{int maNS, namSinh;Strinh hoTen;float diemTB;void nhapHS( ){Scanner sc = new Scanner(System.in);System.out.print(“Nhap Ma:”);maNS = sc.nextInt( );System.out.print(“Nhap Ho Ten:”);hoTen = sc.nextLine( );System.out.print(“Nhap Nam Sinh:”);namSinh = sc.nextInt( );System.out.print(“Nhap DTB:”);diemTB = sc.nextFloat( );}void xuatHS( ){System.out.printf(“\n%7d”, maNS);System.out.printf(“%15s”, hoTen);System.out.printf(“%7d”, namSinh);System.out.printf(“%7.1f”, diemTB);}} class HocSinh{float diemTB;void nhapHS( ){Scanner sc = new Scanner(System.in);System.out.print(“Nhap DTB:”);diemTB = sc.nextFloat( );}void xuatHS( ){System.out.printf(“%7.1f”, diemTB);}} Xem đáp án