+3 Jacob Fellows · December 6, 2014
Hi there,
I'm struggling with my assignment on queues that is to create a program that creates a print queue and am allowed to use any method such as a linked list, dequeue or the queue<E> function. I would rather use the queue function as it seems simple.
I have attached the java class code I have done so far and I am learning to use these code boxes as well.

The java class code:
package bobsyouruncleassignment2;
import java.util.*;
 * @author Jacob
public class DeQueCode
{ //Start of class
    int fileSize;
    private String fileName;
    private String userID;
    private UUID printerID;
    *This is the constructor of the JavaDoc for my program
    * It is used to create a new print job.
    *@param fileSize is the file size
    *@param fileName is the file name
    *@param userID is the user Identification
    * @param printerID is the identification for the printer
    public DeQueCode(int fileSize, String fileName, String userID, UUID printerID)
    { //The word *this.* means set the value in the instance of a print job
        this.fileSize = fileSize;
        this.fileName = fileName;
        this.userID = userID;
        this.printerID = printerID;
    } //End of the constructor
    //Now to the methods that are going to be used in my program
    //Starting with the getters
     * Gets the file name
    public int getFileSize()
        return this.fileSize;
     * Gets the last name
      public String getFileName()
        return this.fileName;
     * Gets the telephone number
        public String getUserID()
        return this.userID;
        *Gets the printer ID.
        public UUID getPrinterID()
            return this.printerID;
        //Now the setters
         * Sets the print job for the file size
         * @param fs file size of the print job
    public void setFileSize (int fs)
        this.fileSize = fs;
         * Sets the print job for the file name
         * @param fn file name of print job
       public void setFileName (String fn)
        this.fileName = fn;
         * Sets the print jobs user name
         * @param ui user ID for the print job
       public void setUserID (String ui)
        this.userID = ui;
        * Sets the print job a random printer ID
        * @param
       public void setPrinterID (UUID pi)
           this.printerID = pi;
       //Finally the toString method to show all the print jobs info
     public String toString()
         return ("File sizee: " + fileSize + "\n"
                 + "File name:" + fileName + "\n"
                 + "User ID: " + userID + "\n"
                 + "Printer ID: " + printerID);
} //End of class

I would like to then make the program itself have a few option choices such as the code below that will go along with the above.
    public static void main(String[] args) {
    Queue q = new Queue(); //Queue of size 5
    int ch;
    Scanner sc =new Scanner(;
    System.out.println("Enter choice :");
        case 1:
            System.out.println("Enter data to insert");
        int x=sc.nextInt();
        case 2:
            System.out.println("Queue underflow");
                int z =q.delete();
                System.out.println("data deleted =" + z );
        case 3: q.display();
        case 4: q.destroy();
        case 5: break;
        default : System.out.println("Wrong Choice");

Please help and all the help is greatly appreciated from you guys as you seem to know stuff better than I do and I would love to become part of your java crew.
Thanks again,
P.S If you do help me Santa will be very happy with you this year! :) LOL

Post a Reply


- page 1
Oldest  Newest  Rating
+1 Jacob Fellows · December 16, 2014
Fair play to you. Many people look at these forums and don't help out people if they need it and that is what really annoys me as I have used another forum site called whirlpool and the forums are really dead on that site as people don't want to help each other.

Anyways have a Great Christmas!!!

0 Developer John · December 15, 2014
I'm sorry as well. Even though I was brave enough responding here, I felt bad no one could help. I'm not even close to hitting Java Intermediate yet because I'm understanding all the rules of methods, constructors, and even classes. I want to soak up enough information as I can in order to help people here on the forums. Without help, the forums would be dead. Once I hit Java Intermediate and get to the Queue tutorial, I'll look up all the documentation for them and even go through Oracle tutorials for them. The only way I helped you was trying to tell you what I knew you could easily fix.

-Have A Great Christmas! 

+1 Jacob Fellows · December 15, 2014
Hi there,

It didn't go well and I was kind of hoping for more help rather than a list of resources to go look at. I was hoping for help as in putting our minds together and thinking of a solution to my problem one step at a time. The program I built runs and displays the first message and then a referral message to the end of January.

I think I am going to email the course leader tomorrow to see if I can sit with him and ask him for the help I need and to see if there is anything we can do together to get me back up and running with my mind set so that I love java and will give it a shot in the barrel if I have too.

The reason I was wanting help is that I struggle to have any kind of inspiration or something to look forward too after I have done this course, my head isn't in the right place at the moment and I suffer in silence from bad personal mistakes and decisions.

Thanks for trying to be helpful I really appreciate it and would like you to help me out in future with any problems I have. Hopefully you can help me understand it with examples of code that I could use.

On a positive note have a great Christmas and new year!!! Also look out for a post from me when you are not busy with family over Christmas as I may need help.

Thanks from a tired out and needing to be inspired student,

PS sorry for not replying so soon busy with other assignments!
0 Developer John · December 12, 2014
How did it go? I'm guessing not well.:(
0 Developer John · December 11, 2014
Okay, first off, you're not stupid. Your resources are on this site btw. Tutorial 15 in Java Intermediate will help you with queues, and tutorials 78-81 will help you with your file problem.
0 Jacob Fellows · December 11, 2014
Hi there,

The assignment is meant to be in by 11pm UK time tonight so I am going to just use code I already have and manipulate it so that it works. I haven't used an array deque before and I have looked into how a normal queue works. I would still like the help though.

I would like to manipulate the code so that it allows the user to add a document name. file size, user ID and printer ID.

Thanks from a stupid student named Jacob.
0 Developer John · December 10, 2014
Okay, I understand. So, how exactly do you want to change this program? Have you had much experience with Queues in Java lately?;)
+1 Jacob Fellows · December 10, 2014
Yes sorry its just that I thought you weren't going to be helpful after what you said. :)
0 Developer John · December 9, 2014
Lol, now you sound desperate. I never really said I was giving up, I just wanted to share my thoughts on this. So, shall we continue?:sideways:
0 Jacob Fellows · December 9, 2014
Hi There Developer John,

I thought you were going to be my little helper but I guess not. I have spent hours trying to find an example of the sort of code that I needed for the assignment so that I could use it as an example and make sure that I build the correct way. So yeah, I need the help and expertise of someone that has more java knowledge than me. I will always try to help others out and have found this site to be better at responding to a thread or post that someone has created over whirlpool and many like it. I also prefer this forum because we can have fun and see what people need help with.

Thanks from a tired, worried student named Jacob.

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator