关键词 > Java代写

48024 Applications Programming Assignment 1 Guide

发布时间:2021-04-19

48024

Applications Programming

Assignment 1 Guide


Aim:

This guide is intended to help students to get started on the assignment. You may skip to the section that you need help with.

The assignment is designed to be completed week by week.

The first message is that there are no tricks in the assignment. If you apply the processes and patterns you have learnt, you should have little trouble completing at least the passing requirements of the assignment.


Weekend 5

At the end of Week 5, you should be able to complete the following:

1. Declare the constructors – you may need to partially complete constructors that initialize Lists.

2. Declare the toString() functions.

3. Implement the main Game Kiosk menu.

Everything you need to know to complete the above steps is covered in the Study 5 module, and the tutor demo for week 5.

If you are not sure how to do some of the tasks above, it is recommended that you open sample code as a reference.

The sample code contains examples of everything above. There is sample code included in the Study 5 module download link (https://canvas.uts.edu.au/courses/16738/files/1165758?wrap=1). You can also watch the tutor demonstration video in Study 5.

Classes and fields

Already provided in ED.

Constructors

You should be familiar with how to write constructors from Week 5. While you may not be familiar with Lists just yet, they can be temporarily ignored. If you don’t remember the Constructor patterns, you should consult your Patterns Book (you wrote them down right?).

toString() functions

toString() functions also feature in Week 5. The specifications are given fairly directly in the specifications document.

The Main Game Kiosk Menu

This is the menu pattern. This is also the first menu that is shown when the user runs your application. Following the standard pattern, you’ll put this menu into a method named use(). Also following the standard pattern, you’ll need a main() method to start your program, and this main method should call the use() method to show the menu.

The point that’s sometimes difficult to understand here is that the main() method is a static method, while the use() method is an instance method. Therefore, the main() method cannot simply just call the use() method otherwise you will get an error such as “non-static method cannot be invoked from a static context”.

What you need to understand is that because the use() method is an instance method inside Kiosk, you need to first create an instance of the Kiosk class, and then you can call the use() method on that instance. This is what the Study 5 example shows you how to do. If you follow the pattern as shown, your main method will create a new instance before invoking the instance method.

Sometime within Weeks 5 and 6 you will need to complete the other menus as well.


Week 6

In Week 6, you should watch the Study 6 module on lists and complete at least the following features related to lists:

1. Instantiating and initializing the lists in the constructors. Remember that you may choose any class that implements the List interface (you will need to import java.util for most of them). I personally recommend ArrayList, but for this assignment, you shouldn’t notice anydifference.

2. Add a Customer to the Kiosk.

3. Add a Game to the Catalogue – note that you must also keep track of the Genre to be able to search by it later, this will involve checking existing genres to see if the “new” one is already there.

4. Remove a Customer from the Kiosk.

5. Remove a Game from the Catalogue.

6. Rent a Game to a Customer.

7. Return a Game.

8. Keep track of which Games have been rented and which haven’t.

These goals are moderately difficult to implement. Make sure you plan carefully before diving into the coding – it may be useful to review the processes you know for designing OO applications.


StuVac

If you remain on track, you should be starting to move to the more advanced List manipulation:

1. Keeping track of Customer records.

2. Displaying Customer records.

3. Topping up Customer accounts.

4. Preventing a game rental if the Customer does not have sufficient funds.

5. Removing holds appropriately.


Week7

If you have kept up, you should be close to fully completing the assignment, with stuvac to consider how to extract favourites data from the Customer record. If you are attempting this, you should be at the point where manipulating Lists no longer poses difficulty - your brain power here will be needed to consider how to get the information out reliably.