Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pinal txan 40 pointa Question Schoolkid that is the base class tor children at a school. it should have teacher, and a greeting. It attributes

image text in transcribed
Pinal txan 40 pointa Question Schoolkid that is the base class tor children at a school. it should have teacher, and a greeting. It attributes for the chiid's name and age, the nane of the child's should have appropriate acceasor and mutator nethoda for each of the attributes ) Derive a class Exaggerat ingkid trom schoolkid. The new class should override the accessor . It also should override the accessor for method for the age, reporting the actual age plus a the greet ing, returning the child'a greet ing concatenated with the words I an the best. )Create teating class 40 points Question 2 abatract nethod computeDiscount that will return the discount from the purchase ot a given number of a singie item. The method has two parameters, count and itemcost a) create an abstzact class Diacount Policy. It should have a single It should have a conatructor that b) Derive a class buywztemadetOneFree from Discount Policy. 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 items and the cost of each item is s10, then the discount will be $20 aince every 3rd iten will be tree. If n ia 4 and the cost of each item is $10 and if the user buys 7 items, then the discount will be $10. c) Create teating class Question #3 20 points Create a LeftArrow class that derives from the Shape class tail 8 head 11 head/2 5 head/2-1 4 0 1 3 head/2-2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

Students also viewed these Databases questions