Car Inventory

UTILITYDOCUMENTSTOOLS

Contract purpose

Contract that keeps track of classic car collection.

Contract parameters

manager : address of the record manager

Exposed methods and variables

addCar : allows the manager to introduce a new car to the list

parameter nametypedetails
_numberstringthe unique number of the car (plate number)
_brandstringthe brand of the car (+model)
_nrOfKmintegerthe number of Km the car was used for
_yearintegerthe production year of the car

getCar : returns the details of a particular car

parameter nametypedetails
_numberstringthe unique number of the car (plate number)

getNewest : returns the details of the newest car ( production year). If 2 cars were produced in the same year, the one which was added to the list more recently is returned

getOldest : returns the details of the oldest car ( production year). If 2 cars were produced in the same year, the one which was added to the list more recently is returned

updateKm : allows the manager to update the number of km for a car

parameter nametypedetails
_numberstringthe unique number of the car (plate number)
_kmintegerthe number of km to be added to the existing value
Buy
Reviewed by Modex
Buy Contract Test Contract

Create an account or login to purchase this smart contract