Results 1 to 1 of 1
- 03-10-2013, 08:28 AM #1Member
- Join Date
- Mar 2013
- Rep Power
Passing an object to an abstract class?
Hi. I am new to this forum, and have registered to ask questions when I don't understand the assignments provided for the programming courses I take. My instructor doesn't speak the best English, so sometimes it's hard to understand what he's asking for.
The first part of the assignment, which I have already completed, is as follows:
A mechanic shop has 100 customers, each of which is an object in an array, which holds various data. The Base class is Service, and there are four derived classes for specific services (tires, oil, radiator, and brakes). Each customer is assigned one service. A list of all customers with the details is printed.
The second part, I do not understand what he is asking for at all:
We are printing coupons if the last service was done over a certain number of months ago. I have already made calculations for the dates, and if the service was done a certain amount of time ago, I need to pass one object in the service array to the abstract coupon class. His exact instructions are these:
Coupon is an Abstract parent class. The abstract class should have variable year, month and day. Make a Service Coupon extend the Abstract coupon class. Several child classes - BrakeService Coupon, Tire Coupon, Engine Oil Coupon, Radiator Coupon extend the Service Coupons. Add an Expiry date to a random date in 2013 and Make it final in the constructor of the objects. The service object calls the coupon passing the service object. The coupon determines the type of service object it receives and accordingly prints the message. This should be simple.
Am I supposed to be passing the object to the abstract class? If so, am I supposed to take my main class and make it an extension of the abstract coupon class?
Sorry that I can't be more clear. I don't know what he wants either.
Thank you in advance,
- By darshanaprasad in forum New To JavaReplies: 4Last Post: 12-15-2012, 11:07 PM
- By alladin in forum New To JavaReplies: 15Last Post: 02-14-2012, 12:25 PM
- By rgeurts in forum New To JavaReplies: 4Last Post: 04-14-2011, 12:42 PM
- By Vinaya Lal Shrestha in forum SWT / JFaceReplies: 0Last Post: 04-03-2009, 02:50 PM
- By Santoshbk in forum New To JavaReplies: 6Last Post: 02-11-2009, 11:51 AM