Bike = bikeType + bikeNumber + hireCharge + depositCharge + bikeState
bikeType = *the type of bike requested by the customer*
bikeNumber = *the unique identifying number of the bike*
hireCharge = *daily cost of hiring the bike*
depositCharge = *how much deposit must be paid when hiring the bike*
bikeState = [“in stock” | “hired” | “in repair” | “scrapped”]
getBikeNumber: returns bikeNumber of the bike
getHireCharge: takes bikeNumber as an argument and returns its hireCharge
checkBike: to record the state of the bike. For example when the bike is returned, bikeState will be changed from “hired” to “in stock” or “in repair”
Customer = name + address + telephoneNumber + amountCharged + amountPaid
name = *the name of the customer*
address = *the address of the customer*
telephoneNumber = *the telephoneNumber of the customer*
amountCharged = *the total amount by which the customer is debit*
amountPaid = *the total amount by which the customer is in credit*
updateName: takes the name of the customer as an argument and stores it in name
updateAddress: takes the address of the customer as an argument and stores it in address
updateTelephoneNumber: takes the telephone number of the customer as an argument and stores it in telephoneNumber
updateAmountCharge: takes the value of a bill to the customer as an argument and adds it to amountCharged
updateAmountPaid: takes the value of a payment from the customer as an argument and adds it to AmountPaid
HireTransaction = startDate + estimatedDays + returnDate + hireCost + extraCharge
startDate = *the date a particular hire starts*
estimatedDays = *how long the customer says they would like to hire a particular bike for at the point when they take it from the shop*
returnDate = *the date that the bike is actually returned
hireCost = *the total cost of a particular hire of a particular bike. Does not include the penalty for returning a bike late*
extraCharge = *the set penalty for returning a bike late*
inputStartDate: takes the start date of the hire of a particular bike as an argument and stores it in startDate
inputEstimatedDays: takes the number estimated days a particular bike is to be hired as an argument and stores it in estimatedDays
inputReturnDate: takes the date a particular bike is actually returned as an argument and stores it in returnDate
calculateHireCost: takes startDate, returnDate and hireCharge as arguments and calculated the cost of the hire of a particular bike. It is then stored in hireCost.
Customers = customerList
customerList = *the list of all customers of GoGreen bikes*
findCustomer: takes the customer's name as an argument and returns instance of Customer
addCustomer: allows a new instance Customer to be added to to the list
deleteCustomer: allows an instance of Customer to be deleted from the list
Bikes = bikeList
bikeList = *the list of all bikes belonging to GoGreen bikes*
findBike: takes the bikeNumber of a bike as the argument and returns the instance of Bike
findType: takes the bikeType as the argument and returns all instance of Bike with the same type.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment