Question: refurn Pinal txan 40 points Question #1 a) Crea te a class Sehoolkid that is the base class for children at a school. It should
refurn Pinal txan 40 points Question #1 a) Crea te a class Sehoolkid that is the base class for children at a school. It should have attributes for the child's name and age, the nane of the child's teacher, and a greeting. accessor and mutator nethods for each of the attributes ) Derive a class Exaggeratingkid from sehoolkid. The new class should override the accessor . It also should override the accessor tor method for the age, reporting the actual age plus a the greeting, returning the child'a greeting concatenated with the worda "I am the best c) Create teating class 40 points Question 2 an abetzact class DiacountPolicy, It should have a aingle abstract method computeDiacount that wi1 return the discount trom the purchase ot a given number ot a singie stem. The method has two parameters, count and itemcost conatructor that b) Derive a class buywztemadetonePree trom Discount Policy. It should have a has a single parameter n The data member of this class will be n. In addition, the elass should define the method computeDiscount so that every nth item is free. For example, if n is 3 and the eustomer buys 7 itema and the cost of each item is $10, then the discount vill be $20 since every 3rd item will be free. If n ia 4 and the cost of each item is $10 and if the user buys 7 items, then the diacount will be $10. c) Create testing class Question #3 20 point Create a LeftArrow class that derives from the Shape class. tail 8 head 11 head/25 head/2-1 4 0 1 3 head/2-2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
