Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please finishing all code labeled TODO in this ticketing application. comments help me learn the most so please comment as much as you can! package

Please finishing all code labeled TODO in this ticketing application.

comments help me learn the most so please comment as much as you can!

package week_7.q2_ticket; import java.util.Date; public class Ticket implements Comparable { private int priority; private String reporter; // Stores person or department who reported problem private String description; private Date dateReported; private final int ticketID; // The ID for each ticket - an instance variable. Each Ticket will have it's own ticketID variable // TODO Problem 5: Tickets need to store the resolution Date in a variable called dateResolved // TODO Problem 5: and a String describing the resolution, in a variable called resolution. // Add two new fields (variables) here. // You do not need to modify the constructor. When a new tickets is created, // the user will not know the data resolved or the resolution. public Ticket(String desc, int p, String rep, Date date) { this.description = desc; this.priority = p; this.reporter = rep; this.dateReported = date; this.ticketID = TicketCounter.getNextCounterValue(); } public int getTicketID() { return ticketID; } protected int getPriority() { return priority; } public void setPriority(int priority) { this.priority = priority; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getReporter() { return reporter; } public void setReporter(String reporter) { this.reporter = reporter; } public Date getDateReported() { return dateReported; } public void setDateReported(Date dateReported) { this.dateReported = dateReported; } public String toString(){ // TODO Problem 5. Modify this method. If the ticket is not resolved, return the String below. // If the ticket is resolved, return a String that includes the same data plus the resolution, and date resolved. return "ID: " + this.ticketID + " Description: " + this.description + " Priority: " + this.priority + " Reported by: " + this.reporter + " Reported on: " + this.dateReported; } @Override public int compareTo(Ticket otherTicket) { // Joint equal priorities, sort with oldest first if (this.getPriority() == otherTicket.getPriority()){ return this.getDateReported().compareTo(otherTicket.getDateReported()); } else { // Sort with smallest priority number at the start return this.getPriority() - otherTicket.getPriority(); } } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems analysis and design

Authors: Alan Dennis, Barbara Haley Wixom, Roberta m. Roth

5th edition

978-1118057629, 1118057627, 978-111880817

More Books

Students also viewed these Programming questions

Question

Why is intrinsic motivation healthier than extrinsic motivation?

Answered: 1 week ago

Question

Compare and contrast system testing and acceptance testing.

Answered: 1 week ago

Question

Explain the process of balancing a set of DFDs.

Answered: 1 week ago