辅导案例-INFS1609-Assignment 2

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top

UNSW Business School


School of Information Systems and
Technology Management





INFS1609 Assignment 2 (15%)

Revision Date Changes
1 28/10/2019 Initial release
2 08/11/2019 Changed stationary calculation


Assignment Design
• This assignment is to be undertaken as an individual assignment
• This assignment is graded upon 15 marks and counts for 15% of your Overall
Marks for this course
o This assignment only contains 1 part
• The assignment is due on Friday 22nd November 2019, by 1200hrs (noon)
o If you would like to make a submission after this date you will need to
email your submission directly to the head tutor
• The assignment must be submitted electronically via Ed > Assessments
o Submission requirements are underlined in each respective part
• Test cases might be used to do a first-round marking of your code. You
should try to run your program on Ed to check if they pass the test cases. Test
run your code as early as possible because you might need to make
changes to your code.
• Please use the Ed discussion forum to discuss any issues related to this
assignment.
• The readability of your code is one of the marking criteria. You should take
care of your coding style and include comments in your code (wherever
appropriate) to help explain it



Please make sure you have read the information about UNSW Business School
protocols, University policies, student responsibilities and education quality and support on
your Course Outline:
https://www.business.unsw.edu.au/degrees-courses/course-outlines/archives/INFS1609-
2018-S2#policies

If you have any questions about interpreting the assignment and its requirements, please
make use of the Lecturer’s consultation sessions. To avoid confusion and misunderstanding,
we will not be answering assignment-related questions over email.
Part 1 – Tutorials Marks (6%)

Implement a simple system to calculate a student’s tutorial mark for each week. Your program
should ask for: the student’s name, tutorial, number of questions for that week, number of test
cases passed, the number of test cases and weighting of each question. Your program should
then print the score and the Moodle summary data.

You will need to design a TutorialMark class which contains the appropriate attributes to store
all of the information. You must create the appropriate getter, setter and constructor methods.
You may create additional classes if you feel that it is necessary for this task.

We will provide you with a TestTutorialMark class, this class is responsible for prompting the
user for input and displaying the output as required below. Text written in red below in the
samples indicate user input. Round to 1 decimal place when required.

You can assume that all values entered are valid.

Enter student’s name: Charlie Brown
Enter student’s tutorial: T14A
Enter number of questions: 3
# Enter questions in format: passed,total,value
Enter Q1: 5,5,5
Enter Q2: 2,4,2
Enter Q3: 3,6,3

# Moodle Summary
Charlie Brown – T14A
Q1 (5/5) 5.0
Q2 (2/4) 1.0
Q3 (3/6) 1.5

Total: 7.5



Marking Criteria:
Presentation &
correctness
( 2 marks )
1 mark* Style and cleanliness, indentation, camelCase
1 mark* Programming correctness, variable naming, placement of
methods
* No partial marks awarded
Test cases
( 4 marks )
4 marks per test case – 4 test cases total
Plagiarism 90% penalty for the entire assignment for substantial plagiarism
More information on the appeal process and what is considered to be plagiarism is available on
the course outline


Part 2 – Stationary Store (9%)

You’ve been asked by a stationery store to implement a basic database system. The
relationship between the objects is dictated below:



Each class has the following attributes:
• Product(int id, String name, int quantity)
• Stationery has in addition (String colour)
• Technology has in addition (int powerConsumption, int warrantyPeriod)
• Furniture has in addition (int weight, boolean warehouse)

The stationery shop is a bit quirky; the price of each item is calculated in the following way:
• Product = length of the product name * quantity
• Stationary = length of the product name * quantity
• Technology = power consumption / warranty period
• Furniture = weight / quantity

Programming tasks (8%):
• Using your knowledge of OOP, Inheritance and Polymorphism design, implement the
classes above
• You should submit 6 Java files: Stationery.java, Technology.java, Furniture.java,
Product.java, StationerySystem.java and TestStationerySystem.java
• You will need to implement a StationarySystem class which is in charge of
maintaining the objects, the StationarySystem constructor should take an int which
specifies the number of different product types the StationarySystem can hold, and
should provide the following publicly accessible methods described under the
functionality table
• The price of items should be a double rounded to 2 decimal places where necessary
• All items are located at the store by default, only certain furniture items are located at
the warehouse

Design explanation (1%):
• You must submit a design.txt file containing your answer to the following question
(100 word maximum):
Explain how you have implemented printInventory() and if applicable, which aspect of
OOP are you utilising to do so?

Functionality Table:

public boolean insertProduct(String productString)

The boolean will indicate whether the Product was successfully created. Returns false if
the product id already exists or if the StationerySystem is full. You will need to parse
the Strings and create objects from them.

The productStrings will come in the following formats:
PDT,id,name,quantity
STN,id,name,quantity,colour
TECH,id,name,quantity,powerConsumption,warrantyPeriod
FURN,id,name,quantity,weight,warehouse
public int inStock(int productId)

This should return the quantity of the product in stock, or -1 if the product doesn’t exist
public boolean sell(int productId)

This method will reduce the quantity of the item by 1 and return true else returns false if
the quantity is 0 or the productId doesn’t exist
public boolean restock(int productId, int quantity)

This method will increase the stock of a particular product by the quantity specified, if
the productId does not exist it should return false, else true. Assume quantity is always a
positive number
public void printInventory()

This should print the store inventory in the following format and in the order they were
loaded into the system:
Type Id Name Quantity Price WAREHOUSE
STN 0 Pencil 100 $600.00 N
STN 1 A4 500 Pages 10 $120.00 N
STN 2 Sharpener 10 $90.00 N
public void closeStore()

This should empty the StationarySystem and restore it to an empty state

Marking Criteria:
Presentation &
correctness
( 2 marks )
1 mark* Style and cleanliness, indentation, camelCase
1 mark* Programming correctness, variable naming, placement of functions
* No partial marks awarded
Functionality Tests
( 6 marks )
1 mark insertProduct functions correctly
1 mark inStock functions correctly
1 mark sell functions correctly
1 mark restock functions correctly
1 mark printInventory functions correctly
1 mark close store functions correctly + mystery test case
There may be more than one test case required to determine each mark
Design Explanation
( 1 mark )
1 mark correctly explain your implementation of printInventory()
Plagiarism 90% penalty for the entire assignment for substantial plagiarism
More information on the appeal process and what is considered to be plagiarism is available on
the course outline

51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468