Question: java coding project 1.overview 1.1 introduction Stanley's Storage offers storage units for customer to rent. Location are dotted around the Northwest. Write supplier code to

java coding project

1.overview 1.1 introduction Stanley's Storage offers storage units for customer to rent. Location are dotted around the Northwest. Write supplier code to help Stanley manage his location, customer, and storage units. This will not include UI; assume that is being created by another team.

1.2 Storage Locations Stanley's Storage locations are identified by a unique name that has two upper-case letters indicating the state, followed by two digit representing the location number within the state, followed by the city name. Example are "WA23Issaquah" and "OR02Ashland". Each location is identical in layout, having 12 rows, each with 20 storage units.

1.3 Storage Units Units are one of three types: standard, humidity controlled, and temperature controlled. Attributes of interest include the unit's width, length, and height, and the unit's standard price. Rented units have a customer associated with them(1) as well as a price which they were rented(which may be different from the standard price)

1.4 Customers Each location manages its own list of customers. Assume for now that no more then 100 customers will be necessary. For each customer Stanley's maintains a name, phone number, and account balance.

2. Client Code Requirements Client code must be able to...

2.1 Storage Locations * Retrieve the storage location's designation * Retrieve a storage unit(2) by index * Add a cust customer to the list; retrieve a customer by index; retrieve a count of customers * Retrieve an array of storage units rented to a specified customer(3) * Retrieve an array of all empty(unrented) storage units, or unit of a specified type * Change monthly rent(charge custmers for each unit they are renting, increasing their balance)

(1) Note the specific language here; units know about customers, but not the other way around, in this model. (2) We're in an object-oriented world; you should converse in objects, rather than strings or other data types, wherever it makes sense (3) Do not create more than a single array in this process; use no other data structures, either, for this method or any of the similar ones listed. 2.2 Strage Units * Retrieve each attribute. Price retrieved should be rented or standard price, whichever is applicable * Retrieve the rental start date(4) * Retrieve the customer associatedwith the unit(5) * Rent the unit to a specified customer, on a specified date * Release the unit (make it "unrented")

2.3 Customers * Retrieve each attribute; update the customer's name or phone number * Change the customer a specified amount, or credit them a specified amount

4 Code Implementation 4.1 Building Blocks You'll Nedd * Classes and objects * "Has a" relationships * Array2D (6) * Enumerated types

4.2 Preconditions Establish preconditions for the following cases, throwing appropriate exceptions with helpful and informative messages) when the preconditions are violated: * Storage location designations must fit the specified pattern discussed above. * Storage unit lengths and widths are always multiples of four; height, multiples of two. Dimensions must be positive numbers greater than zero * Customer charges and credits must be non-negative. * Add other preconditions that make sense and are critical to the proper operation of the objects. Consider, for example, important strings that shouldn't be null or empty, and object references that shouldn't be null * You should not throw exception in cases where parameter values would cause runtime errors that would be clearly understandable to client coders, e.g, array out-of-bounds errors. (4)Let's be smart and use objects, not strings or integers; we're better than that, or should be, now! Use standard American short-date format, e.g. 11/07/2017 for November 7th, 2017. (5)When the unit is not rented, we'd expect the customer and the rental date to be null (6)Only regular(retangular) 2D arrays are to be used in this project; we'll get to jagged arrays later.

4.3 Other Requirements * Store all storage units a single, regular (rectangular) 2D array. * Create all Storage units, and fill in their attributes, when the storage location is created; don't postpone unit creation. Make the size and prices whatever you want, for now. * Create no static method or variables In a few cases, static constants might be resonable. * Use no class-level public variables. Class-level public costants are okay. * Use method exposure (public and private) wisely; expose what Client code needs, hide internal-use methods. * This is no main method is part of the model. But do create one to show off the project's capabilities, however (e.g., far-reching navigation and to String results). * Create and enumberated type for storing the unit type. * Write a toSritng method for each class. include all data helpful in describing the object's state. for containers, include the contained, as well, and ensure the resulting strings look good when displayed. *Within the created classes, do not converse with the user; there should be no input or output. It is okay for method to return strings that will be used from client code, however, and to include exception messages which will be senn if client code breaks the rules and misuses your class. Main can converse with the user, of course. 4.4 Style Follow the Course Style Guide, which is linked in the Reference section of the Modules list in Canvas

6. Hints * Build and test each class, one at a time, starting with the most basic bilding block. * Clever use of toString method will it easier to create toSritng methods in container classes. * A complete object diagram will be of great help when navigating project drill-downs. *If you know a little about regular expressions, you'll be able to make some precondition checking code very compact and concise; research the matches method on String objects. *When testing, either test with stubbed code(function headers with no bodies and hard-coded return values), or test as if you are testing another student's code. think about what might go wrong in the scenario. Remmeber that test code can contain more lines than production code. if you write your test early, they'll benefit you as you flesh out the project; one touch of a button will run all the test you've written up to this point. 7 Extra Credit Within the storage location's constructor, read sample customer data from a plain-text file called Customers.txt, stored in your project folder. this file(or its name) should not be passed in from client code; it's the data file used for this purpose, so just read it. Put about ten customers inthe file as sample data, and to use for testing and demonstration purposes. Do not hard-code any paths; if you place the file in your project folder, it should work fine with its name alone.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!