+1-617-874-1011 (US)
+61-7-5641-0117 (AU)
+44-117-230-1145 (UK)
Live Chat

# CAL3033 Program Design and Development Assignment 2

```{`Programme Bachelor of Computer Sciences (Hons)
Course Code and Title CAL3033 Program Design & Development
University of Lincoln
Assignment title 	Assignment 2: Implementation and Justification
`}```

This assessment assesses the following course learning outcomes

 # as in Course Guide KDU PG UC Learning Outcome LO3 Understand and employ object oriented programming and make use of Collection classes and be able to implement data structures such as lists, queues and trees together with algorithms to process these structures (e.g. searching and sorting). LO4 Understand algorithm complexity and the big-O notation, and use this knowledge to select suitable data structures for a particular scenario.
 # as in Course Guide UL Learning Outcome LO1 (Algorithms and Complexity) understand the time and space efficiency of algorithms and how to calculate/estimate/evaluate and improve them LO3 (Algorithms and Complexity) demonstrate the ability to select from a range of possible options, to provide justification for that selection, and to implement algorithms in a particular context. LO2 (Object-Oriented Programming) use advanced object oriented principles and programming techniques in software development LO3 (Object-Oriented Programming) apply advanced logical and mathematical techniques in the development of software solutions

## Scenario

A restaurant would like to provide food delivery service to their customers. The restaurant would like to have a system to manage the order placing and delivery of the food orders. There are two types of customer, delivery customers or self-collect customers. The customers will place their orders via phone or leave message from social media and the receptionist will key in the orders into the system. The delivery of orders could be immediately or scheduled to a specific date and time. Payment could be made by cash on delivery or pay via credit card. The system will also be used to arrange the orders to different riders according to the area of delivery. The food which is not delivered will be returned to the restaurant. Assume that the restaurant is operating daily, from 9 am to 10 pm. The last order for delivery will be accepted latest by 9.30 pm.

Generally, the company requires a system that is capable of performing the following tasks:

1. Adding records for food menu, riders, delivery customers, and walk-in customers, validating the information according to the descriptions given;
2. Adding food ordering records when customers placing the orders.
3. Assigning riders to deliver the orders. A list of delivery record should be generated based on the area of delivery. For example, assign one rider to handle the orders according to the postcode of delivery. Refer https://worldpostalcode.com/malaysia/pulau-pinang for more information. Your program should focus on assigning orders in Penang Island area only. The orders with any other postcode will not be accepted.
4. Removing records when orders delivered or updating records when orders returned.

NOTE: you are not required to implement all of this functionality; the following section details exactly what you are required to do.

You are required to perform, individually, the following tasks.

## Task A—System Implementation (70 marks)

An analyst has produced a system that has the following functionality:

• Has a main menu screen that provides access to these functions, and to the functions related to the features listed below.

You are required to add additional functionalities to this system, as follows:

• Make sure the file reading routines validate the information they read. You are required to do the following:
1. Create collections in which to store customers, food menu, riders and orders. You should consider carefully what type of collections to use, and be prepared to justify it. You may choose to store delivery customers or self-collect customers in either one collection or two separate collections, and be prepared to justify your choice.
1. You are required to modify the routine to add validation of the input data. If the data read from the text file does not satisfy validation, the record should not be created nor added to the relevant collection.
• You are required to add functionalities as follows.
1. To place an order: Allow user to enter all necessary information. If the order is placed by a registered member, the user should just key in the customer phone number as an ID. Once the ID has been entered, the details of the customer should be displayed. There will be delivery charges for orders based on the number of meals as shown in Table 1.

Table 1 Delivery charges based on number of meals ordered

 Number of meals Delivery Charges (RM) 1 - 4 10 5 - 9 5 10 and above Free of charge

However, the restaurant also provides free delivery to the following postcodes: 11700, 11800, 11900 and 11950. There will be a 10% special discount given to self-collect customers. Your program should focus on accepting orders in Penang Island area only. The orders with any other postcode will not be accepted.

1. To assign delivery of orders: The user may process the orders by arranging riders to deliver the food. A list of delivery record should be generated based on the area of delivery. For example, assign one rider to handle the orders according to the postcodes of delivery. Refer https://worldpostalcode.com/malaysia/pulau-pinang for more information.
1. To update status after delivery: Once the riders come back after delivery, they should inform the user of the system to update the status of delivery. The orders which are fail to be delivered should be recorded.
• A function to list the riders, customers, food menu, orders, delivery list and returning list on the console.
• Save data: this should save the order records, delivery records and returning records to text files using a PrintWriter class.
• Load data: this should read the saved records, using a Scanner, and reinstate them when the data is loaded.

You are not required to add any other functionality such as addition and removal of food menu and riders.

Marks will be awarded for two aspects of the implementation:

• The functionality provided by the system (60 marks)
• The quality of the coding (10 marks)

For the functionality, full credit will be given for each aspect that has been correctly implemented; partial credit will be given for a reasonable but not wholly correct implementation; no credit will be given for features which have not been implemented or which do not compile.

For the code quality, marks will be awarded with good use of commenting throughout, including Javadoc comments for the vast majority of classes, methods and variables. Code is well structured and clear; classes, methods and variables are almost all well named.

You are required to write a report, detailing the reasons for the choice of data structures used in your program for storing the records. The report should be a maximum of 5 pages A4, 12pt text. If the report is over this length, there will be no penalty but only the first 5 pages will be read.

You should give comprehensive discussion of the complexity, efficiency and overall suitability of the data structures you employed and consider all reasonable alternatives within the Java collections API that might have been used instead. Make sure you cover the Big-O notation for the discussion on the complexity of algorithms. The discussion should be supported by appropriate quality references.

This assignment must be solely your own work, although you may of course refer to the jointlyproduced material from part 1 of the assignment as necessary.

Any sources you make use of must be referenced correctly.

Any plagiarism or collusion will be dealt with according to KDU Penang University College regulations.

Each student should submit a report containing the following:

• A cover page as provided in Canvas.
• Originality report from the Turnitin web site.

The report should be should be submitted together with the Java source code. You may zip the report and all your Java source code files. If packages have been used the files should be stored in an appropriate directory structure. The .zip file should also include, in addition to the code, a plain text (.txt) file giving instructions necessary for compiling and running your application. It must not be necessary for any IDE other than Eclipse to be used, or for any libraries which do not form part of the standard JDK installation to be required. If you have used either Eclipse, you can simply submit a .zip file of your project folder.

If you need to make any assumptions in order to implement the system, these should be detailed in your report, together with the reasons for making them.