I am fairly new to Java Inheritance and I don't understand why I have an error?

numanbaba

New Member
Here is the problem:Write the class Marketer to accompany the other law firm classes described in this chapter. Marketers make $50,000 ($10,000 more than general employees) and have an additional method called advertise that prints "Act now, while supplies last!" Make sure to interact with the Employee superclass as appropriate.The code so far:\[code\]public class Marketer extends Employee { public Marketer() { setBaseSalary(super.getSalary() + 10000.0); } public void advertise() { System.out.println("Act now, while supplies last!") ; }}\[/code\]This is what the output should be: 50000.075535.0Act now, while supplies last!There is a file extension called Employee.java on the following site that the code above follows:http://practiceit.cs.washington.edu/problem.jsp?id=1324So what I have so far, it printed out every expected outcome EXCEPT for 75535.0!Where did I go wrong??When I ran the code, it said this (for the error I had received on the 75535.0 part): (change base salary to $65535.00)because my output was 65535.0, which is 10000 less than what the answer is supposed to be.I can't seem to find the error since I just started to do these inheritance kind of things in Java, so I am still unfamiliar with it. Thank you if you can help me understand where I messed up.
 
Back
Top