fork download
  1. package topica.moduel;
  2.  
  3. import java.io.Serializable;
  4. import java.util.Scanner;
  5.  
  6. public class GiangVien extends NhanVien implements Serializable {
  7.  
  8.  
  9. /**
  10. *
  11. */
  12. private static final long serialVersionUID = 1L;
  13.  
  14. private String chucvu;
  15.  
  16. private int ngaycong,phucap;
  17. static Scanner sc = new Scanner(System.in);
  18.  
  19. public GiangVien() {
  20. // TODO Auto-generated constructor stub
  21. }
  22.  
  23. public GiangVien(String chucvu, int ngaycong, Scanner sc) {
  24. super();
  25. this.chucvu = chucvu;
  26. this.ngaycong = ngaycong;
  27. this.sc = sc;
  28. }
  29.  
  30. public String getChucvu() {
  31. return chucvu;
  32. }
  33.  
  34. public void setChucvu(String chucvu) {
  35. this.chucvu = chucvu;
  36. }
  37.  
  38. public int getNgaycong() {
  39. return ngaycong;
  40. }
  41.  
  42. public void setNgaycong(int ngaycong) {
  43. this.ngaycong = ngaycong;
  44. }
  45.  
  46. public Scanner getSc() {
  47. return sc;
  48. }
  49.  
  50. public void setSc(Scanner sc) {
  51. this.sc = sc;
  52. }
  53.  
  54.  
  55. public void menu()
  56. {
  57. System.out.println("!---------------!");
  58. System.out.println("!1.Trưởng phòng-!");
  59. System.out.println("!2.Phó phòng----!");
  60. System.out.println("!3.Nhân viên----!");
  61. System.out.println("!---------------!");
  62. }
  63.  
  64. @Override
  65. public void inputInformation() {
  66. // TODO Auto-generated method stub
  67. super.inputInformation();
  68. menu();
  69. boolean flag = true;
  70. do {
  71. System.out.print("Nhập chức vụ của bạn : ");
  72. int choice = Integer.parseInt(sc.nextLine());
  73.  
  74. switch (choice) {
  75. case 1:
  76. {
  77. this.chucvu ="Trưởng phòng";
  78. this.phucap = 2000;
  79. flag = false;
  80. break;
  81. }
  82.  
  83.  
  84. case 2:
  85. {
  86.  
  87. this.chucvu ="Phó phòng";
  88. this.phucap = 1000;
  89. flag = false;
  90. break;
  91. }
  92.  
  93.  
  94. case 3:
  95. {
  96.  
  97. this.chucvu ="Nhân viên";
  98. this.phucap = 500;
  99. flag = false;
  100. break;
  101. }
  102.  
  103.  
  104.  
  105. default:
  106. {
  107. System.out.println("Nhập sai vui lòng nhập lại !");
  108.  
  109. }
  110. }
  111.  
  112.  
  113. } while (flag);
  114. System.out.print("Nhập ngày công : ");
  115. this.ngaycong = Integer.parseInt(sc.nextLine());
  116. super.setLuong(0.6*730+this.phucap+this.ngaycong*200);
  117.  
  118.  
  119. }
  120.  
  121.  
  122. @Override
  123. public String toString() {
  124. // TODO Auto-generated method stub
  125. return super.toString()+"Cán bộ - chức vụ : "+this.chucvu+"||"+"Ngày công :"+this.ngaycong;
  126. }
  127.  
  128.  
  129. }
  130.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:6: error: class GiangVien is public, should be declared in a file named GiangVien.java
public class GiangVien extends NhanVien implements Serializable {
       ^
Main.java:6: error: cannot find symbol
public class GiangVien extends NhanVien implements Serializable {
                               ^
  symbol: class NhanVien
Main.java:64: error: method does not override or implement a method from a supertype
	@Override
	^
Main.java:67: error: cannot find symbol
		super.inputInformation();
		^
  symbol:   variable super
  location: class GiangVien
Main.java:116: error: cannot find symbol
		super.setLuong(0.6*730+this.phucap+this.ngaycong*200);
		^
  symbol:   variable super
  location: class GiangVien
Main.java:125: error: cannot find symbol
		return super.toString()+"C?n b? - ch?c v? : "+this.chucvu+"||"+"Ng?y c?ng :"+this.ngaycong;
		       ^
  symbol:   variable super
  location: class GiangVien
6 errors
stdout
Standard output is empty