Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

SIMPLE CODING HELP NEEDED FOR JAVA PROGRAM

Here is the program description:

Write a program that supports the following operations:

int add(string login, string time, int priority, int size, int handle): add a new request to a queue; return a sequential ID# if successful, or FULL if the total file size of all pending requests exceeds the maximum spool size of 50MB.

The input argument handle is not used in this exercise, so set it to NULL. The ID cycles in the range of 1 - 1024.

int print_next(): return EMPTY if the queue is empty, or return the ID of the pending highest-priority request and delete it from the queue.

int find_next(): return EMPTY if the queue is empty, or return the ID of the pending highest-priority request.

int cancel(string login): delete all the requests made by the login user; return the number of deleted requests if successful, or return NONE if not found.

int cancel(int ID): delete the request with the ID; return 0 if successful, or return NONE if not found.

String status(): return a string containing information about all pending requests' ID, login, creation time, priority, file size, and file handle; return "EMPTY" if there's no pending request. The order of the print requests returned does not matter.

Error codes: -1 for FULL, -2 for EMPTY, -3 for NONE. (If you add more error codes, clearly state them in your program code.)

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93119339

Have any Question?


Related Questions in Computer Engineering

What is the difference between dekkers algorithm and igloo

What is the difference between Dekkers Algorithm and Igloo approach? Please provide examples that can explain this.

Question recall the optimal page replacement algorithmthe

Question : Recall the optimal page replacement algorithm. The victim page chosen by the algorithm is the one that will not be used the longest period of time. Can this algorithm exhibit Belady's anomaly? Justify your ans ...

If sailsboro just paid a dividend of 2 per share amp

If Sailsboro just paid a dividend of $2 per share & dividends are expected to grow at 8%, 6%, and 5% for the next three years respectively. After that the dividends are expected to grow at a constant rate of 3% indefinit ...

Question suppose you had to design a wired ethernet network

Question : Suppose you had to design a wired Ethernet network for a 4-story office building containing 20 users per floor. Each floor is 90 meters in length and 5 meters in height. Draw a network topology of your propose ...

The freemont automobile factory has discovered that the

The Freemont Automobile Factory has discovered that the longer a worker has been on the job, the more parts the worker can produce. I need help finding an application that computes and displays a worker's anticipated out ...

Recently the discovery of a new data structure wonder heap

Recently, the discovery of a new data structure WONDER HEAP was announced. A WONDER HEAP has the same functionality and worst case behaviour as a binary heap except for DELETE MAX, which is implemented in O(log log n) (i ...

What is the broadcast domain and ports for hubs and

What is the Broadcast Domain and Ports for hubs and bridges?

Recall that a k-ary tree is a rooted tree where each node

Recall that a k-ary tree is a rooted tree where each node has up to k children (for some positive integer k). (a) Write a recursive definition of a nonempty A-ary tree with height h greaterthanorequalto 0. (b) A complete ...

When i have a class that extends application public class

When I have a class that extends Application (public class Game extends Application) I can easily call it from my driver class by typing launch(Game.class). Now I have two other classes where one extends JFrame and the o ...

Question the use of encryption can have adverse effects on

Question: The use of encryption can have adverse effects on incident response and incident investigations; however, from a security standpoint, encryption is a major component in network confidentiality. Present your arg ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As