Goals. The goals of these assignments are: (1) develop,

Added on - 20 Sep 2019

  • 3


  • 1548


  • 207


  • 0


Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 1 of 3 pages
1.GoalsThe goals of these assignments are: (1) develop, and implement Java classes for a business application usingspecific data structures and algorithms; (2) write code for testing the soundness and completeness of yoursolution.2.TasksYour project is to design and develop an inventory system for keeping track of mobile devices rented from labsin a college.We start with the assumptions: (1) labs have unique names and, (2) a lab can stockpile a variable number ofmobile devices. Furthermore, a unique name and a value tag (an integer with values between -100 and 100)define a mobile device type. The same device type can be stored in more than one lab.1.A lab receives a rent request for a device and a period of time2. The period is defined by two dates: the request date and the due date.3. If the device is part of lab’s inventory and the device is available, then the device is rented.4. If the device is not part of lab’s inventory or the device is already rented, the request is sent to another lab. Ifthe request cannot be satisfied, then it is dropped.5. There are no data structures such as queues, for keeping track of the requests. However, the inventory systemworks based on the first-come, first-served principle.A template of the required classes is given to you. Some methods are complete, some are partially implementedand some have only the signature defined. You can find the project template on your online course web page. Itis the last course item calledAssessments.On the assessment section scroll down forAssignment 2link.For example, the classMobileDevicehas been defined as:class MobileDevice {String deviceName; // the device nameint valueTag; // an integer between -100 and 100Lab lab; // the lab having this device it its inventoryRentSettings rs; // rent settings...// inner classprivate class RentSettings {private String rentDate; // date when the item is requestedprivate String dueDate; // date when the item must be returnedprivate boolean borrowed = false; // true if the item is rented...}}The most important method ofMobileDeviceclass ispublic boolean rentDevice(String rentDate, String dueDate, Lab lab) { ... }The method takes three arguments: two strings dates for the renting period and a lab from where the device isrented. If dates are not valid it createsDateFormatExceptionand returns false. IfrentDate>dueDatethrowsRentPeriodExceptionand returns false.If no exceptions occur aRentSettingsobject must be created for the mobile device that is rented.TheDateFormatExceptionandRentPeriodExceptionare user-defined exceptions you have to create andthey are part of project template.The classLabhas two fields: a lab name and a collection of devices stored in the lab (data structureVector).public class Lab implements MaxTagValue {
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document