Answer to Question #296554 in Java | JSP | JSF for aaa

Question #296554

Provide another sub class ProfessionalCertification that extends Certification. This class no additional data member. o It overrides the calculateFee method so that the total cost is returned as the product of hours and cost per hour plus 15% tax of the total hours cost. o Also the ProfessionalCertification implements the Extendible Interface. You will also have to provide the implementation of method extend(int duration). For this you need to add the duration to the training hours of the certification  The correctness of your code will be checked against a main program that will be provided along with the expected output


1
Expert's answer
2022-02-11T11:57:03-0500


interface Extendible {
	void extend(int duration);
}


class ProfessionalCertification extends Certification implements Extendible {


	public ProfessionalCertification() {
	}


	public ProfessionalCertification(int Id, String name, int hours, String level, double costPerHr) {
		super(Id, name, hours, level, costPerHr);
	}


	/**
	 * It overrides calculateFee method so that total cost is returned as product of
	 * hours and cost per hour plus 15% tax of total hours cost.
	 */
	@Override
	public double calculateFee() {
		double fee = super.calculateFee();
		return fee + 0.15 * fee;
	}


	@Override
	public void extend(int duration) {
		setHours(getHours() + duration);
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS