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