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...

1 answer below »
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
Answered Same DayMar 31, 2021COSC1295

Answer To: Microsoft Word - COSC1295 Assignment 1 S1 2020.docx Page 1 of 17 School of Science COSC1295 Advanced...

Arun Shankar answered on Apr 03 2021
148 Votes
UniLink/.classpath

    
        
            
        
    
    
    
UniLink/.project

     UniLink
    
    
    
    
        
             org.eclipse.jdt.core.javabuilder
            
            
        
    
    
         org.eclipse.jdt.core.javanature
    
UniLink/bin/Event.class
public synchronized class Event extends Post {
String Venue;
String dat;
int Capacity;
int A
ttendeeCount;
static int EventCount;
static void ();
void Event(String, String, String, String, String, int);
public String getPostDetails();
public boolean handleReply(Reply);
public String getReplyDetails();
}
UniLink/bin/Job.class
public synchronized class Job extends Post {
double ProposedPrice;
double LowestOffer;
static int JobCount;
static void ();
void Job(double, String, String, String);
public boolean handleReply(Reply);
public String getReplyDetails();
public String getPostDetails();
}
UniLink/bin/Post$Stat.class
public final synchronized enum Post$Stat {
public static final Post$Stat OPEN;
public static final Post$Stat CLOSED;
static void ();
private void Post$Stat(String, int);
public static Post$Stat[] values();
public static Post$Stat valueOf(String);
}
UniLink/bin/Post.class
public abstract synchronized class Post {
String Id;
String Title;
String Description;
String CreatorId;
Post$Stat Status;
java.util.ArrayList replies;
void Post(int, String, String, String);
public String getId();
public String getTitle();
public String getDescription();
public String getCreatorId();
public Post$Stat getStatus();
public void setId(String);
public void setTitle(String);
public void setDescription(String);
public void setCreatorId(String);
public void setStatus(Post$Stat);
public String getPostDetails();
public abstract boolean handleReply(Reply);
public abstract String getReplyDetails();
}
UniLink/bin/Reply.class
public synchronized class Reply {
String PostId;
double Value;
String ResponderId;
void Reply(String, double, String);
public String getPostId();
public double getValue();
public String getResponderId();
public void setPostId(String);
public void setValue(double);
public void setResponderId(String);
}
UniLink/bin/Sale.class
public synchronized class Sale extends Post {
double AskingPrice;
double HighestOffer;
double MinimumRaise;
static int SaleCount;
static void ();
void Sale(double, double, String, String, String);
public String getPostDetails();
public boolean handleReply(Reply);
public String getReplyDetails();
}
UniLink/bin/UniLink.class
public synchronized class UniLink {
static java.util.ArrayList uniPosts;
static String username;
static void ();
public void UniLink();
public static int GetInput(int, int);
public static int ShowLoginMenu();
public static int ShowStudentMenu();
public static void CreateNewEvent();
public static void CreateNewSale();
public static void CreateNewJob();
public static void ReplyToPost();
public static void DisplayAllPosts();
public static void DisplayMyPosts();
public static void ClosePost();
public static void DeletePost();
public static void...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here