The Artima Developer Community
Sponsored Link

Java Answers Forum
Help me please for homework

1 reply on 1 page. Most recent reply: Nov 4, 2012 8:13 AM by Can Cann

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Can Cann

Posts: 2
Nickname: cc15
Registered: Nov, 2012

Help me please for homework Posted: Nov 4, 2012 8:11 AM
Reply to this message Reply
Advertisement
Representation of an object depends
heavily on its use. Below is the UML diagram of a Car class that will be used
by a car dealer. For each car, our dealer stores the following information:
(1) the date (availableSince) this car was placed on the lot, (2) a Boolean
variable (isNew) indicating whether the car is new or second-hand, (3) the
price tag on a new model (newPrice), and (4) a unique identifier (carID).
The dealer determines the selling price of a car using the following
function: if the car is new, it has to be sold at the newPrice. Otherwise,
the price of a (second-hand) car is reduced in proportion to the duration of
time the car stayed on the lot. At Date d, this price is calculated as
depreciated Price(d)=1/millisOnLot(d.availableSciene)

I could not do anything for that question just help me please


Can Cann

Posts: 2
Nickname: cc15
Registered: Nov, 2012

Re: Help me please for homework Posted: Nov 4, 2012 8:13 AM
Reply to this message Reply
Here is the UML diagram;

Car
-----------------------
availableSince : Date
isNew : boolean
newPrice : double
carID : int
------------------------
Car(p : double)
Car(p : double, newFlag : boolean)
depreciatedPrice (Date d) : double
millisOnLot (d1 : Date, d2 : Date) : long

Flat View: This topic has 1 reply on 1 page
Topic: knapsack problem classwork Previous Topic   Next Topic Topic: Stuck in the first java program

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use