This is advanve programming assignment
Microsoft Word - COSC1295 Assignment 1 S1 2020.docx Page 1 of 17 School of Science COSC1295 Advanced Programming, S1, 2020 Assignment Part 1: Console Implementation Assessment Type: Individual assignment; no group work. Submit online via Canvas → Assignments → Assignment 1. Marks are awarded for meeting requirements as closely as possible according to assignment specifications and the supplied rubric. Clarifications/updates may be made via announcements/relevant discussion forums. Due date: end of Week 5 11:59pm Sunday 5th April 2020. Late submissions are handled as per usual RMIT regulations - 10% deduction (10 marks) per day. You are only allowed to have 5 late days maximum unless special consideration has been granted. Weighting: 100 marks (15% of your final semester grade) 1. Overview NOTE: Carefully read this document. In addition, regularly follow the Canvas assignment discussion board for assignment related clarifications and discussion. This assignment requires you to design and implement an object-oriented console application using the Java programming language. The application is named UniLink, which allows all students in a university to create and publish various types of posts and reply to those posts. In this assignment, UniLink supports three types of posts as shown below: ● Event: the post creator specifies information about an upcoming event. Other students can see that post in the UniLink system and reply to the post to attend that event. ● Sale: when a student has an item to sell, that student can create a sale post in the system and provide necessary details about the item. The post is visible to other students and each of them can reply with a price they want to pay for the item. More sale rules are described in the Sale class specifications below. ● Job: this is another type of post to enable a student to describe a job which the student needs to hire someone to do and the price at which the student expects to pay for that job. Other students can see the job post in the system and reply with different prices they want to get paid to do the job. More requirements about job posts are described in the Job class specifications below. Users of the UniLink system can also view all the posts, manage their own posts, review all replies to their posts, close and delete their own posts. See the next sections for more information about system features and implementation requirements. Page 2 of 17 Disclaimer: the specification in this assignment is intended to represent a simplified version of a system in real life and thus is not meant to be a 100% accurate simulation of any real system or service that is being used commercially. 2. Assessment Criteria This assessment will determine your ability to implement Object-Oriented Java code according to the specifications shown below. In addition to functional correctness (i.e. getting your code to work) you will also be assessed on code quality. Specifically: ● You should aim to provide high cohesion and low coupling. ● You should aim for maximum encapsulation and information hiding. ● You should rigorously avoid code duplication. ● You should use superclass methods to retrieve and/or manipulate superclass properties from within subclass methods where necessary. ● You should take advantage of polymorphism wherever possible when invoking methods upon objects that have been created. ● You should comment important sections of your code remembering that clear and readily comprehensible code is preferable to a comment. 3. Learning Outcomes This assessment is relevant to the following Learning Outcomes: CL01: use the Java programming language in the implementation of small to medium sized application programs that illustrate professionally acceptable coding and performance standards. CL02: demonstrate knowledge of the basic principles of the object-oriented development process and apply this understanding to the analysis and design of solutions for small to medium scale problems. CLO3: describe and apply basic algorithms and data structures, in particular simple searching and sorting of data stored in data structures and manipulating data. 4. Assessment details The UniLink system allows students to create and publish many types of posts. All those posts share a set of common attributes and methods and also have their own different sets of attributes and behaviors. The following sections describe the requirements of the Post superclass and its subclasses that you must implement in your code. Page 3 of 17 Post class Note: I've created several videos as examples to make it easier to understand and implement the assignment requirements. https://drive.google.com/drive/folders/1cRbdnPdKtQT_4wBqd8ySwc2GKSLPLJCk?usp=sharing All videos are in the folder shown above. You should watch the LogInLogOut first, then Create Event/Sale/Job post, then Respond to Event/Sale/Job post. Attributes Each post object has the following attributes: ● Id: a string which uniquely identifies each post. The UniLink system must generate a unique id for each newly created post according to the following format: ○ An event post id begins with the string "EVE" followed by a three-digit, zero-padding number. The first event post has id EVE001, the subsequent event posts have id EVE002, EVE003, EVE004, EVE005… ○ A sale post id begins with the string "SAL" followed by a three-digit, zero-padding number. The first sale post has id SAL001, the subsequent sale posts have ids SAL002, SAL003, SAL004, SAL005… ○ A job post id begins with the string "JOB" followed by a three-digit, zero-padding number. For example, the first job post has id JOB001, the subsequent job posts have id JOB002, JOB003, JOB004, JOB005… ● Title: a short string to summarise the post. It can be a name of an event in an event post, or name of an item in a sale post or name of a job in a job post. ● Description: a longer string which provides more information about the post. It can be a description of an event, or an item on sale or a job specification. ● Creator id: a string which is the id of the student who created the post in the UniLink system. Student id begins with the character 's' followed by a number, for example, s1, s2, s3… are all acceptable student id in this assignment. ● Status: indicates whether the post is open to receive replies or closed and no longer accepts replies. In your implementation, you must make sure that a post status can only be either OPEN or CLOSED. ● Replies: a data structure of your choice, for example an array or array list, to store all replies to a post. Each reply is an object of the Reply class. More details about this class are shown in the "Reply class" section further down this document. Constructors At least one constructor to initialize all attributes shown above. By default, a post status is set to OPEN when a post is created. Your implementation should not allow constructors in the Post class to be used directly to create Post objects. Instead, these constructors should only be called in constructors of subclasses of the Post Page 4 of 17 class, such as the Event, Sale and Job classes (more details below). Remember that one of our objectives is to reduce code duplication, especially when initializing common attributes of all post objects. Methods public String getPostDetails() This method should build and return a string which contains information about a post. In this Post class, which is a superclass, the getPostDetails method only build and return a string containing the post id, title, description, creator id and status, which are common attributes of all types of post as shown above. This method is overridden in subclasses of the Post class to add more specific details relevant to each type of post, which will be described in the next sections. The returned string should be formatted in a human readable form as shown in the examples below. Example: calling the method getPostDetails() on an event post object will return the following String: ID: EVE001 Title: Movie on Sunday Description: Join us to see a movie this Sunday with ticket discounts applied to all group members! Creator ID: s3456223 Status: OPEN Note: details about event id, title, description, creator id and status are obtained by calling the getPostDetails() of the Post class. Venue: Village Cinema Date: 29/03/2020 Capacity: 3 Attendees: 0 The getPostDetails() method must be overridden in the Event subclass of the Post class to display more specific details about the event such as venue, date, capacity and the current number of attendees. More in the Event class specifications below. Abstract methods public abstract boolean handleReply(Reply reply) Each type of post has a different way to handle a reply, therefore in this Post class, which is the superclass, this method is set to abstract and will be implemented in concrete subclasses of the Post class, i.e. in Event, Sale and Job classes Page 5 of 17 This method receives a reference to a Reply object, which store all details of a reply to this post. Specifications