mga boss pa help bat ayaw mag display ng name? dina kaya ng utak ko kahit anong gawing explore ko e saka pa check narin po if tama yung code ko naka follow ba sa instructions nasa baba po pic
Hello! I'm here to help you with your coding issue. To properly assist you, could you please provide the code that you are currently working on? You mentioned that the name is not displaying. By looking at the screenshot you attached, I can help you check if the code is correct and if it follows the instructions given. Let's work together to solve this problem.
Hello! I'm here to help you with your coding issue. To properly assist you, could you please provide the code that you are currently working on? You mentioned that the name is not displaying. By looking at the screenshot you attached, I can help you check if the code is correct and if it follows the instructions given. Let's work together to solve this problem.
public static void main(String[] args) {
String worktype;
Scanner sc = new Scanner (System.in);
Employee Pol = new Employee();
FullTimeEmployee Ftime = new FullTimeEmployee();
PartTimeEmployee Ptime = new PartTimeEmployee();
System.out.print("Enter name: ");
Pol.setName(sc.nextLine());
System.out.print("Enter F for Full Time or P for Part Time: ");
worktype = sc.nextLine();
if (worktype.equalsIgnoreCase("P")){
System.out.print("Enter rate per hour and no. of hours worked separated by space: ");
Ptime.setRatePerHour(sc.nextDouble ()); Ptime.setHoursWorked(sc.nextInt());
System.out.println("Name:" + Ptime.getName());
System.out.println("Wage: " + Ptime.getWage());
}
else if (worktype.equalsIgnoreCase("F")){
System.out.println("Enter Monthly Salary :");
Ftime.setMonthlySalary(sc.nextDouble());
System.out.println("Name: " + Ftime.getName());
System.out.println("Wage: " + Ftime.getMonthlySalary());
Sa baba ng "Enter name"
String name = sc.nextLine();
Ftime.setName(name);
Ptime.setName(name);
Dapat dun sa RunEmployee (Main class)
Actually, no use si Pol na diyan eh dahil parent class mo na yan sa FTE at PTE.
Set the values dun sa child class ni Employee
Sa baba ng "Enter name"
String name = sc.nextLine();
Ftime.setName(name);
Ptime.setName(name);
Dapat dun sa RunEmployee (Main class)
Actually, no use si Pol na diyan eh dahil parent class mo na yan sa FTE at PTE.
Set the values dun sa child class ni Employee
okay na paps nag ask ako kay gpt same logic lang sayo kaso ginamit niya pa pol kaya ayun na submit ko btw thanks at least alam kona now puwede pala ganyan