Please use Java
Design a class called supportTicket that handles information about reported IT support issues. A ticket includes an id number, the location of the equipment (e.g., building and room number), a short description of the issue, and a priority level. A valid priority level is a positive integer value with 0 being the highest priority level Tickets are serviced based on their priority level, from highest to lowest. Assume each ticket is assigned a unique priority level. When a ticket is serviced, it is removed from the list.
1) Define an array-based heap class (or an ArrayList -based heap )
2) Use class Heap defined above to store the service tickets described above
3) Create a menu-driven interface that allows the user to (1) add a support ticket, (2) service a ticket (remove it from list), and (3) list active tickets in order of their service priority. Your menu-driven interface continuously gives the user the option to perform one of the above operations until the user choose exit the program.
******start of code for SupportTicket.java*********
public class SupportTicket implements
Comparable<SupportTicket> {
private int idnumber;
private String location;
private int priorityLevel ;
private String sortDescription;
public int getIdnumber() {
return idnumber;
}
public void setIdnumber(int idnumber) {
this.idnumber = idnumber;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public int getPriorityLevel() {
return priorityLevel;
}
public void setPriorityLevel(int priorityLevel)
{
this.priorityLevel =
priorityLevel;
}
public String getSortDescription() {
return sortDescription;
}
public void setSortDescription(String sortDescription)
{
this.sortDescription =
sortDescription;
}
@Override
public int compareTo(SupportTicket o) {
return (this.getPriorityLevel()
< o.getPriorityLevel() ? -1 :
(this.getPriorityLevel() == o.getPriorityLevel() ? 0 :
1));
}
}
******End of code for SupportTicket.java*********
Explanation of SupportTicket.java Class
In this class 4 instance variable and setter and getter method and we have implemented Comparable interface and override the compareTo() method (this is because we have to sort the object of this class by priority of ticket).
***********Start of code for SupportTicketMenu********
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Scanner;
public class SupportTicketMenu {
public static void main(String[] args) {
ArrayList<SupportTicket> al1 =new
ArrayList<SupportTicket>();
while (true) {
Scanner CC = new Scanner(System.in);
SupportTicket t1=new SupportTicket();
System.out.println("\nMENU");
System.out.println("1 - add a support ticket");
System.out.println("2 - service a ticket ");
System.out.println("3 - list active tickets in order of their
service priority");
System.out.println("q - Quit\n");
System.out.println("Choose an option:");
char option = CC.next().charAt(0);
if (option == '1') {
System.out.println("Enter id number");
int id = CC.nextInt();
System.out.println("Enter location");
String loc=CC.next();
System.out.println("priotity level");
int pl = CC.nextInt();
System.out.println("sort description");
String sd=CC.next();
//System.out.println(al1.size());
/* SupportTicket t1=new
SupportTicket(id,loc,pl,sd);*/
t1.setIdnumber(id);
t1.setLocation(loc);
t1.setPriorityLevel(pl);
t1.setSortDescription(sd);
al1.add(t1);
//System.out.println("al1.size();"+al1.size());
}
if (option == '2') {
System.out.print("service a ticket");
System.out.println("Enter id number");
int id = CC.nextInt();
//System.out.println("size before deletion "+al1.size());
Iterator iter = al1.iterator();
while (iter.hasNext()) {
SupportTicket t2=(SupportTicket) iter.next();
if(t2.getIdnumber()==id)
{
al1.remove(t2);
}
}
//System.out.println("size after deletion "+al1.size());
}
if (option == '3') {
System.out.println("list active tickets in order of their service
priority");
SupportTicketSorterByPriotity jobCandidateSorter = new
SupportTicketSorterByPriotity(al1);
ArrayList<SupportTicket> sortedSupportticket =
jobCandidateSorter.getSortedSupportTicketByPriority();
Iterator iter = sortedSupportticket.iterator();
while (iter.hasNext()) {
SupportTicket t2=(SupportTicket) iter.next();
System.out.print(" ticket number"+t2.getIdnumber()+" ");
System.out.print("priotity "+t2.getPriorityLevel());
System.out.println();
}
}
if (option == 'q') {
System.exit(0);
}
}
}
}
***********End of code for SupportTicketMenu********
Explanation of SupportTicketMenu:- this is menu-driven interface where end has to perform the operation and test the result .end user will select the one of the option and perform there operation.
"MENU"
1 - add a support ticket"
2 - service a ticket
3 - list active tickets in order of their service priority
q - Quit
************Start of code SupportTicketSortedByPriority*******
import java.util.ArrayList;
import java.util.Collections;
public class SupportTicketSorterByPriotity {
ArrayList<SupportTicket> st = new
ArrayList<SupportTicket>();
public
SupportTicketSorterByPriotity(ArrayList<SupportTicket> st)
{
super();
this.st = st;
}
public ArrayList<SupportTicket>
getSortedSupportTicketByPriority() {
Collections.sort(st);
return st;
}
}
************End of code SupportTicketSortedByPriority*******
Explanation of SupportTicketSortedByPriority: I have created this class to sort the Array List object(SuportTicket) according to priority.
Screen shot of output


Please use Java Design a class called supportTicket that handles information about reported IT support issues....
Must be in JAVA
1. Design and implement a Binary Heap class that must support "insert" and "deleteMin" operations 2. Design and implement a driver (the main method) that does the following: (a) Creates an array that contains a list of 4099 integers, in a random order, between 0 to to 4098. (b) insert, into the first binary heap that is initially empty, the numbers in the array sequentially from the start to the end (c) Initialize the second empty...
JAVA PROGRAMMING PLEASE This lab has three parts: Create an ArrayList class. Create a LinkedList class. Print out the results after testing each of the methods in both of the classes and solving a simple problem with them. Task 1 – ArrayList Class Create an ArrayList class. This is a class that uses an internal array, but manipulates the array so that the array can be dynamically changed. This class should contain a default and overloaded constructor, where the default...
Amusement Park Programming Project Project Outcomes Use the Java selection constructs (if and if else). Use the Java iteration constructs (while, do, for). Use Boolean variables and expressions to control iterations. Use arrays or ArrayList for storing objects. Proper design techniques. Project Requirements Your job is to implement a simple amusement park information system that keeps track of admission tickets and merchandise in the gift shop. The information system consists of three classes including a class to model tickets, a...
Suppose there is a hospital with a waiting room filled with
several patients. Patients are prioritized based on how severe
their casualities are. For instance, car crash andgun shot patients
are priority level 1, so they go straight to the front of the
queue. Patients with heavy chest pain or mild heart attacks are
priority level 2, and so on.
Create a hospital that manages patients in a list. Implement it
using the LinkedList API. (You may import ArrayList or...
For this question, we want to implement the basic java classes to support the concept of an Online Store and a shopping cart. Consider an e-store with various types of items: books, flowers, gift cards, etc... and we like to be able to support the ability to handle a shopping cart that can contain various types of items. For this question you are asked to create the following classes: abstract class: “Item” every item has a unique item_id (a positive integer,...
ONLY NEED THE DRIVER CLASS PLEASE!!! Domain & Comparator Classes: 0.) Design a hierarchy of classes, where the Media superclass has the artistName and the mediaName as the common attributes. Create a subclass called CDMedia that has the additional arrayList of String objects containing the songs per album. Create another subclass called DVDMedia that has the additional year the movie came out, and an arrayList of co-stars for the movie. 1.) The superclass Media will implement Comparable, and will define...
In Java, create a program implementing the functionalities of a standard queue in a class called Queue3503. You will test the functionalities of the Queue3503 class from the main() method of the Main class. In a queue, first inserted items are removed first and the last items are removed at the end (imagine a line to buy tickets at a ticket counter). Do NOT change your class name from "Main". The Main class should come first in your code. Your filename should be "Main.java". The Queue3503 class will contain:...
In class, we discussed the priority queue (PQ) ADT implemented using min-heap. In a min-heap, the element of the heap with the smallest key is the root of the binary tree. On the other hand, a max-heap has as root the element with the biggest key, and the relationship between the keys of a node and its parent is reversed of that of a min-heap. We also discussed an array-based implementation of heaps. In this assignment, your task is to...
Java Create a program for a car dealer to use where you have a class for Salesman, Cars, and the Records of sale. 4 salesman and 4 cars to start with but have array size for 50 cars, have space for 100 records in array. The program should have 6 options in the menu. buy car, sell car, show inventory, show salesman, show sales records, and exit. Salesman class - Name, ID number, Commision rate, Total commisions earned, Totals number...
n JAVA, students will create a linked list structure that will be used to support a role playing game. The linked list will represent the main character inventory. The setting is a main character archeologist that is traveling around the jungle in search of an ancient tomb. The user can add items in inventory by priority as they travel around (pickup, buy, find), drop items when their bag is full, and use items (eat, spend, use), view their inventory as...