Results 1 to 1 of 1
- 03-10-2013, 07:28 AM #1
Member
- Join Date
- Mar 2013
- Posts
- 1
- Rep Power
- 0
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:
Here is what I think it is asking for (purely as an exercise for demonstrating we know how to use abstract and inheritance):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,
~E
Similar Threads
-
Passing a class's object as parameter to a method...
By darshanaprasad in forum New To JavaReplies: 4Last Post: 12-15-2012, 10:07 PM -
Problem in passing an object class through socket
By alladin in forum New To JavaReplies: 15Last Post: 02-14-2012, 11:25 AM -
Class is not abstract and does not override abstract method run(com.
By rgeurts in forum New To JavaReplies: 4Last Post: 04-14-2011, 11:42 AM -
Passing SWT object to another class
By Vinaya Lal Shrestha in forum SWT / JFaceReplies: 0Last Post: 04-03-2009, 01:50 PM -
Difference between Abstract class having only abstract method and a Interface class
By Santoshbk in forum New To JavaReplies: 6Last Post: 02-11-2009, 10:51 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks