| |
|
|
Job Summary:
|
| |
| Job Type: |
Project |
| Budget: |
$ 20-100 |
| Required
Skills: |
|
| Attached
Files: |
(None) |
| |
|
| Status: |
Work Performed (selected user roybuet)
|
| |
|
|
|
Buyer Summary:
|
| |
| Username: |
|
| Feedback Score: |
        
8
reviews
|
| Award Reliability: |
8 posted 8 paid |
| |
|
| Location: |
APO, AE, United States
|
| Member Since: |
July 7, 2006 |
| |
|
|
|
| Invited Users: |
There are no invited users
|
Description
In Project 3 you will make some modifications to an application consisting of three Java executible programs and two data wrapper classes. These programs are complete and operational except that they do not save their data to disk or retreive data from disk when needed. You job is to write the code that will perform those operations for them. As you work on the methods you need to modify read the comments at the beginning of the methods to understand more about their requirements. Also study look over the code I have written so you have a better idea of how the classes work. Be sure you know what instance data exists in each class. In all file I/O methods you must process the exceptions in a reasonable way. You should not throw the I/O exceptions from these methods. You should print helpful messages to the screen when file I/O problem occur.
The template files are attached to this topic in a zip file.
The job of this application is to enter customer's orders for items that are advertised in a catalog for sale and at a later time generate invoices for the orders to be included when the order is shipped. The application contains the following five classes:
ItemManager.java
ItemManager allows you to generate the database of items that are in the catalog. It is supposed to save its data to a binary file named catalog.dat. It also reads in catalog.dat if the file exists when the program starts up so that you can add items or delete items from the existing catalog and then save your changes. Thus, it is a catalog management utility.
In ItemManager you need to provide the file I/O code in the following two methods. You do not need to change any other methods but you may still want to review the code:
saveCatalog - In this method you must save the "catalog" array to the file catalog.dat. The "catalog" instance variable is an array of CatalogItem objects representing the items available to be ordered by customers and placed on invoices. The method needs to return true if the save was successful or false if an error occurred. It is also required to set the instance variable "catalogModified" to false when it successfully writes the catalog to the disk file. This flags the fact that the data in the file and the data in memory are identical. You write the "catalog" array as a single object to the file, not as individual elements. When this is wroking correctly OrderEntry will be able to read the catalog.dat produced so that catalog items can be added to customer orders. loadCatalog - This method does two things: It reads in a new "catalog" array from file catalog.dat if it exists. If it does not exist or cannot be read it creates a new "catalog" array using the instance variable "newCatalogSize" to specify the size of the array. The value of newCatalogSize is set by the constructor so you do not have to do anything except use the value. The reason it creates the new array if the file cannot be read is that the first time you run this class the file catalog.dat will not exist. So, it creates a new empty array that you can fill with data using the program and then save to disk in the catalog.dat file. When the program asks for the maximum number of catalog items when it starts up be generous. Specify at least 100 even though you will not add that many.
To accomplish the modifications to this class first implement saveCatalog. Run the program and try adding some items. Then save them to the file. If all seems to go well, implement loadCatalog. After saving a catalog, exiting the program, re-running it, and reviewing the catalog content in the program you should be able to see that the items you saved are still available when the catalog is loaded. You should be able to load the catalog, make changes (additions and deletions), save it again, and see that the changes you make are preserved in catalog.dat. Get this working correctly before moving on.
OrderEntry.java
OrderEntry allows you to enter customer orders. You enter some data about the customer. Then you specify which items from the catalog the customer has ordered and how many of each item. OrderEntry reads catalog.dat so that it can give you the list of catalog items that are available in the catalog to place in customer orders. Upon command the program saves the order data to a binary file named orders.dat. The orders.dat file is created new each time the program is run. We assume that some other program reads orders.dat and keeps a permenant record of orders. We do not concern ourselves with that in this problem. InvoicePrinter will read orders.dat in order to produce invoices.
You need to provide file I/O code in the following methods:
loadCatalog - This method reads catalog.dat and puts the array saved in it into the "catalog" instance variable. This is what makes the catalog data available to the program so it can be used to create customer orders. You need to read the data into the "catalog" instance variable. If the process fails you abort (exit) the program because without the catalog no customer orders can be produced.
saveOrders - This method saves the instance data "orders" array to the file orders.dat. It is fairly similar to saveCatalog but is saving different data. It has to return true if the save operation succeeded or false if it did not. The "orders" array is saved as a single object.
To accomplish the modifications to this class first implement loadCatalog. When it is working correctly you will be able to select catalog items in the program to build customer orders. Once loadCatalog is working you can implement saveOrders. Whe saveOrders is working InvoicePrinter will be able read orders.dat to print the invoices.
InvoicePrinter.java
InvoicePrinter reads orders.dat and prints out invoices for the orders in it. it is the simplest of the three executible programs. You need to implement file I/O code in just one method:
loadOrders - Thois method loads the orders.dat file that you created in OrderEntry. It needs to return true if it succeeds or false if it does not. The class variable that will receive the data is named "orders" like it is in OrderEntry. It is not actually instance data, however, because InvoicePrinter uses only static methods and static class variables. But that really does not change what you need to do in the method.
CatalogItem.java
CatalogItem objects store the information about each item listed in the catalog. When the item has been added to an order the quantity ordered is stored in this object. This is a data wrapper class and you do not need to modify it. You will be saving an array of CatalogItem objects to the catalog.dat file.
Order.java
Order objects store all the information for one customer order. Thisd includes an array of up to 20 CatalogItem objects. This is a data wrapper class and you do not need to modify it. You will be saving an array of Order objects to the orders.dat file.
All functions of the applications should have been implemented correctly except for the storing and retreival of data. However, you might be able to find some things that need to be fixed in them depending on what data you enter. The methods necessary to perform the file I/O have been declared but have empty or dummy bodies. The objective of this project is to write the bodies of those methods and test them using the functions already implemented. The methods you need to modify have been implemented in the template programs so that the programs will compile butt hey will not run correctly until the needed file I/O is added to
Reminder
You may not start working in this and any request before
your bid is accepted. Users who violate this policy
may have their accounts permanently suspended.
|
|
|
|
| |
| Get the Free
Step-by-Step Guide on How to Use GetACoder |
The act of
outsourcing jobs has become easy in the past few years
thanks to GetACoder. However, our team aims at making the
whole process even easier. So, it has now come the time to
provide you with a step-by-step guidance on how to use this
service and succeed in the outsourcing world totally for
FREE.
It doesn't matter if you are a more experienced user or a
novice; using GetACoder will become even simpler with the
help of this E-book. There are two major sections: a Buyers
section and a Coders section.
Buyers will learn:
- How to outsource safely
- How to pick the best freelancers
- How to manage time and money
Coders will learn:
- How to get the best jobs
- How to secure their payments
- How to build a long-lasting relationship with buyers
...and MUCH MORE
Clear examples and pictures illustrating key situations,
great tips and real testimonies of some of our best users...
all in this Outsourcing Guide. So don't loose the
outstanding opportunity to download GetACoder FREE E-book.
|

 |
|
GetACoder is a leading Global Services Marketplace doing business in more than 200 countries. Our unique system accelerates your time to market and provides your business with key competitive advantages. When you use GetACoder you are stretching your budget and saving as much as 60% over traditional outsourcing. GetACoder is changing business, now it's no longer about what you own or build but which resources and talent you can access. With GetACoder you reduce expenses, increase efficiencies, aggressively grow your business, and create a sustainable competitive advantage. GetACoder makes outsourcing to any part of the world an easy task! With GetACoder it's simple to outsource any business request, gain access to global talent and manage jobs online. One of the main advantages of GetACoder is the low labor cost. The typically rates are about seven times lower than the ones in the US or Europe. Posting a request at GetACoder allows the right professional or company to find you and to bid for your work. We are building a reputation for exceeding our customers' expectations and for becoming an extremely cost effective way to outsource work. Use GetACoder when you want to save money, increase efficiency or accelerate the development of your request. With GetACoder you focus on growing your business and let others do the tedious work. Post your request on GetACoder for free. Find out why people outsource jobs with us day after day. Thousands of Satisfied Customers - Submit/View Quotes
| - | GetAcoder is a nice place to work for both buyer and seller. - | | - | GetACoder is an amazing system, with an amazing staff team ready to respond to your requests. Looking to outsource a project, or looking to get something made for you? Look no further than GetACoder! - | | - | Thanks very much GetACoder for helping us. I am very satisfied with the support team at GetACoder. I have had nothing but first class help in every situation.
Regards - |
|
|
| |
© 2004-2012 GetACoder. All rights reserved. |
|