48024 Programming 2 Assignment 1 Topics:
OO Design, Standard Patterns, Lists
Learning Outcomes:
This assessment task addresses the following subject learning objectives (SLOs): 1, 2 and 3
Due Date:
23 September 23:59
Weight:
35%
Individual Work
All work is individual. You may discuss ideas, approaches and problems, but you should write every line of code yourself except for code copied from the lecture notes, lecture code or lab code. You MUST NOT let another student see your solution code, and you MUST NOT look at another student’s solution code. More information about Academic Misconduct can be found at:
http://www.gsu.uts.edu.au/rules/student/section-16.html
Working Language:
You can choose either Java or Python to complete assignment 1. The higher mark between your Java solution and Python solution will be counted into your final grade. However, you are only credited with one of your solutions, either Java or Python, not both of them or the mixture.
Visualizations of the specification have been illustrated in Java. However, the requirements remain identical between both Java and Python. A starting scaZold for both Java and Python has been provided on Canvas and ED.
Specification
The team at the Prog2 Warehouse has hired a software engineer to develop a new management system. The company owns many stores (referred to as suppliers) in the Sydney region, each supplier is managed by a Manager. The main goal of the software is to be able to interact with each supplier from both the Customer and Manager side.
Customers, when successfully logged in, can shop from any of the suppliers owned by the company, including browsing the products and purchasing products. Customers can only see and order products that are marked as ‘available’. Their shopping history should also be reflected in the Customer details. The supplier should record a profit from any customer’s order.
Managers, when successfully logged in, should be provided unlimited access to any of the suppliers that they are the manager for. This includes being able to add, remove, restock and delist products from the supplier. Managers can order from their supplier as well, but it should not cost them anything and the supplier should not record a profit from their order.
When purchasing products from a supplier, users can add or remove products from their cart, cancel the order, or finalize the order by checking out. The ordering process does not change for Customers or Managers, with the exception of the cost.
An aside
While reading the first part of the specification, you will notice there is a lot going on.
-
How many functions did you identify?
-
How many classes did you identify?
-
What are the fields in each class?
-
How many goals did you identify?
-
How many patterns did you think of that might be applicable?
This assignment will be challenging, and you will probably want to manage your time well.
-
How long do you think it will take you to code the functions?
-
How long do you think it will take you to code each goal?
-
A good rule of thumb is to think of an estimate, and then multiply that number by 3 or 4!
-
To manage your time well, you may need to figure out which parts of the assignment you
can
-
start early.
-
Which parts can you start now?
-
Which parts can you start in week 6?
If you complete parts in the same week that you learn the topics (while they are fresh in your mind), they will take less time to complete.
Requirements
Your design will consist of exactly the following classes with the listed fields, declared as indicated. You are not allowed to add or remove classes or fields; however, you may add constructors, functions and procedures to complete your design (in fact, you will have to!). You should pay careful attention to the tests on ED, as these will help guide you with some (but not all) of these methods
Classes
Your implementation will consist of the following 10 classes:
• User
• Users
• Customer
• Manager
• Product
• Products
• Supplier
• Suppliers
• Order
• Organisation
The User and Users class have been completed for you, and do not require any additional implementation. You should, however, take the time to understand their structure, as you will need to inherit the User class to implement the Customer and Manager class.
Additionally, the following 2 classes are provided in the scaZold, but should also not be edited in any way:
-
Exceptions/NoSuchUserException (You will have to catch an instance of this error thrown in the scaZold code)
-
In (This contains all input related methods required for your implementation)
o ThisclasshasnotbeenprovidedinthepythonscaZoldasitisunnecessary.You cannot add or remove classes in your implementation.
Fields
All fields necessary for your implementation have been provided in the scaZold. For python, due to it’s syntax, you may not to rely on the class diagram. Do not modify them. You may not remove them, you may not change their datatype, you may not change their access level, you may not add more of them.
Constructors
Some constructors have been completed for you, others have not. All constructors in the scaZold, and on the class diagram, indicate which parameters are required. All fields of all classes should be initialized in the constructor, regardless of whether a relevant value is passed through to the constructor or not.
The classes diagram is depicted in the figure below:
Additional Requirements and Notes
-
Your code should be robust, and deal with invalid input elegantly. For the most part, the testcases check for invalid input with the same data type, but nothing else. For example, if the user is selecting an item from a list with an index, your code mustn’t crash if the user enters -9999. But the testcases will not enter a completely diZerent datatype, such as a String.
-
Most classes should have a toString() implementation that returns a human readable string representation of the object. Use the ‘Check’ feature on Ed to verify this.
-
Again, you cannot add or remove classes, and you cannot modify the fields provided in the scaBold in any way.
o Youalsocannotmakeanyadditionalimportstatements.
o TheonlyexceptiontothisisimportinganotherclassinthescaBoldwhenusing python (if required).
-
Dummy data for users, products and suppliers are entered into the system as soon as the program is run. The testcases assume you have not changed this, don’t change it.
o Foryourconvenience,thereisaCustomerentrywith‘1’fortheusernameand‘1’ for the password; and a Manager entry with ‘2’ for the username and ‘2’ for the password. Note that the testcases will check against a variety of credentials.
-
Make sure you understand the purpose of the Cart and Order class. The order class is an abstraction of a single Product, and a quantity. To compare this to a real-world scenario: at the grocery store, if you took 2 bananas oZ the shelf, this would be an instance of the Order class where banana is the Product, and the quantity is 2. That Order object would then be placed inside your Cart (along with many other Order objects).
-
The Suppliers and Products classes are just abstractions of a List of Supplier or Product objects respectively. Any functionality relating to a single Product should be in the Product class. Any functionality relating to a collection of Product objects should be in the Products class. The same goes for Supplier/Suppliers.
Expected Workload
The time to do the assignment to a credit/distinction level has been estimated at 35 hours for a student of average ability who has completed all the tutorial and lab exercises. It is always better to start earlier than later, as you don’t know which small error will consume all your time.
Online Support
A FAQs (Frequently Asked Questions) page will be posted as a slide in the Assignment page on Ed. This is not a static page filled with text, it is a question thread where you can post questions for the teaching staZ to answer. Your question should strictly relate to the specification, questions regarding code problems or testcase issues should go on the regular discussion board. Any questions that do not adhere to this rule will be deleted. If you have a question, check the FAQ first, it may already have been answered there.
Anything posted to the FAQ by the teaching staB is considered to be part of the assignment specification.
As for “normal” assignment questions and assignment help, the preferred way to ask is through participating in the lectures, lab activities, UPASS and consultation sessions.
The Subject Coordinator may be contacted by email if you have matters of a personal nature to
discuss, e.g.,
illness, personal issues or other matters of importance. All emails sent to the subject
coordinators, tutors or lecturers must have a clear subject line that states the subject number
followed by the subject of the email.
e.g.:
[Subject 48024, Appointment Request], and must be sent from your UTS email address.
Submission
There are 2 parts to your submission. You must submit your source code through Ed by clicking the ‘Mark’ button AND you must submit your filled in cover sheet to Canvas.
Return
Your provisional mark and feedback is generated immediately each time you submit to ED. However, it takes time for the analysis of spoofing, plagiarism, collusion and general cheating, which will start two weeks following the due date. If you are suspected of Academic Misconduct, I will forward your case to the Misconduct Committee and will notify you by manual feedback in ED.
Extension request must be submitted through forms: Extension request for 48024_2024 SPR 48 hours before due. An extension CANNOT be given after the due date. For any extension beyond one week, you will need to submit a Special Consideration following the Special Consideration process for reasons including unexpected health, family or work problems. More information about how to apply for special consideration can be found at: Special Consideration.
Marking Scheme
The marks for the assignment are divided into the following functionality components (note that individual tests may test several functionality components, and a functionality component may be tested by several tests):
Prog2 Warehouse Manager
Login 5 Customer Menu 5 Customer Details 5 Supplier Menu (Customer) 5 Supplier Details 5 View Supplier Products 5 Manager Menu 5 Manager Details & Store List 5 Supplier Menu (Manager) 5 View All Products 5 Add Product 5 Remove Product 5 Restock Product 5 Delist Product 5 Cart Menu 5 Adding & Removing Products from Cart 10 Cart Checkout 10 Order as Manager 5