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.  
  65. public void inputInformation() {
  66. // TODO Auto-generated method stub
  67.  
  68. menu();
  69. boolean flag = true;
  70. do {
  71.  
  72. int choice;
  73. do {
  74. try {
  75. System.out.print("Nhập chức vụ : ");
  76. choice = Integer.parseInt(sc.nextLine());
  77. break;
  78.  
  79. } catch (Exception e) {
  80. // TODO: handle exception
  81. e.printStackTrace();
  82. }
  83.  
  84.  
  85. } while (true);
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106. switch (choice) {
  107. case 1:
  108. {
  109. this.chucvu ="Trưởng phòng";
  110. this.phucap = 2000;
  111. flag = false;
  112. break;
  113. }
  114.  
  115.  
  116. case 2:
  117. {
  118.  
  119. this.chucvu ="Phó phòng";
  120. this.phucap = 1000;
  121. flag = false;
  122. break;
  123. }
  124.  
  125.  
  126. case 3:
  127. {
  128.  
  129. this.chucvu ="Nhân viên";
  130. this.phucap = 500;
  131. flag = false;
  132. break;
  133. }
  134.  
  135.  
  136.  
  137. default:
  138. {
  139. System.out.println("Nhập sai vui lòng nhập lại !");
  140.  
  141. }
  142. }
  143.  
  144.  
  145. } while (flag);
  146. System.out.print("Nhập ngày công : ");
  147. this.ngaycong = Integer.parseInt(sc.nextLine());
  148. super.setLuong(0.6*730+this.phucap+this.ngaycong*200);
  149.  
  150.  
  151. }
  152.  
  153.  
  154. @Override
  155. public void inputID() throws ExceptionCharacter {
  156. // TODO Auto-generated method stub
  157. super.inputID();
  158. }
  159.  
  160. @Override
  161. public void inputName() {
  162. // TODO Auto-generated method stub
  163. super.inputName();
  164. }
  165.  
  166. @Override
  167. public void inputAge() throws ExceptionValue {
  168. // TODO Auto-generated method stub
  169. super.inputAge();
  170. }
  171.  
  172.  
  173.  
  174. @Override
  175. public String toString() {
  176. // TODO Auto-generated method stub
  177. return super.toString()+"Cán bộ - chức vụ : "+this.chucvu+"||"+"Ngày công :"+this.ngaycong;
  178. }
  179.  
  180.  
  181. }
  182.  
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:155: error: cannot find symbol
	public void inputID() throws ExceptionCharacter {
	                             ^
  symbol:   class ExceptionCharacter
  location: class GiangVien
Main.java:167: error: cannot find symbol
	public void inputAge() throws ExceptionValue {
	                              ^
  symbol:   class ExceptionValue
  location: class GiangVien
Main.java:148: error: cannot find symbol
		super.setLuong(0.6*730+this.phucap+this.ngaycong*200);
		^
  symbol:   variable super
  location: class GiangVien
Main.java:154: error: method does not override or implement a method from a supertype
	@Override
	^
Main.java:157: error: cannot find symbol
		super.inputID();
		^
  symbol:   variable super
  location: class GiangVien
Main.java:160: error: method does not override or implement a method from a supertype
	@Override
	^
Main.java:163: error: cannot find symbol
		super.inputName();
		^
  symbol:   variable super
  location: class GiangVien
Main.java:166: error: method does not override or implement a method from a supertype
	@Override
	^
Main.java:169: error: cannot find symbol
		super.inputAge();
		^
  symbol:   variable super
  location: class GiangVien
Main.java:177: 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
12 errors
stdout
Standard output is empty