• Post Reply Bookmark Topic Watch Topic
  • New Topic

HELP asap!!!:'(  RSS feed

 
Alexandra Johnson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need help, i am not too sure how to go about this can someone please shed some light on it, with the use of abstract classes, inheritance, and polymorphism.

Write a simulation for a phone company. The company serves two types of clients depending whether they use a mobile phone or not. When you want to make a call you ask the phone company for a connection. In return you receive a unique callID. This will be used to maintain the connection. The person called will obtain the same callID. In order to do so the phone company will contain a Collection of Connections, a Collection of Phones. Whenever a connection is requested an object of type Connection is created containing the caller and the callee. The communication between the two parties is established by passing messages to the phone company who will pass it on the corresponding Connection for handling. Charges for the call are based on the type of phones used and the number of messages sent to a Connection. A connection can be closed by either party after which the caller is informed of the cost of the call. Make sure that you provide means to track the connections and phone calls. Provide a program that demonstrates the full capabilities of your system.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far? The problem asks for a Connection class, and a Phone class. In addition, the behavior varies based on the type of phone, so Phone likely has polymorphic behavior. So you would first think about how these classes would relate to one another. Show us what they look like and then you might ask some more specific questions.
 
Alexandra Johnson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thats the problem, i havent started it, i am not too sure on how to go about it!!!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I told you. You'll want a Connection class, and a Phone class; the Phone class has several subtypes, Mobile and LandLine, say. So start with (mostly) empty class definitions for those. Phone would be either an interface or an abstract class.
These classes have various methods implied by the problem description; the next thing to do would be to sketch those out.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!