Write a program that supports the given operations

Assignment Help Computer Engineering
Reference no: EM132131874

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

Reference no: EM132131874

Questions Cloud

Reaction between aluminum and sulfuric acid : What is the minimum amount of 6.0 M H2SO4 necessary to produce 25.0g of H2(g) according to the reaction between aluminum and sulfuric acid?
Transmittance of the initial stock : What would the % transmittance of the initial stock solution be?
Will you want an int or float or double : Last step is to ask the user if they want to continue doing another operation. Ask them to press a ‘y' for yes and ‘n' for no.
Molecular equation for precipitation reaction : Consider the other product and its phase, and then write the balanced molecular equation for this precipitation reaction.
Write a program that supports the given operations : Write a program that supports the following operations: int add(string login, string time, int priority, int size, int handle).
Calculate the standard deviation value of precipitate weight : Q1: Calculate the standard deviation of chloride concentration of your measurement result Q2: Calculate the relative standard deviation (RSD) of your chloride
Write a program that checks whether or not a given file : Write a program that checks whether or not a given file is formatted correctly for a very simple version of XML.
Aqueous solution containing an unknown monoprotic acid : Suppose 100.0 mL of an aqueous solution containing an unknown monoprotic acid (called HA) is titrated with 0.150 M KOH.
Write a program that encrypts a character from the list : Write a companion program to decrypt the values you encrypt with the given program.

Reviews

Write a Review

Computer Engineering Questions & Answers

  How the selected product could be used by your client

Discussion of how the selected product could be used by your client to support its cybersecurity objectives by reducing risk, increasing resistance.

  Designing a secure online data store

CKDF140 PROJECT Designing a secure online data store -  Risk analysis: which consists of asset evaluations, threat modeling, and vulnerability analysis and Security requirement specification.

  Anti-cyber squatting consumer protection act

Specify what does the Anti-cyber squatting Consumer Protection Act do? Explain how does this act cut down on the nuisance suits?

  Write a test program that prompts the user to enter

Write a test program that prompts the user to enter a, b, c, d, e, and f and displays the result.

  Create an application which is able to translate

Create an application which is able to translate between back and forth between English - letters A-Z and numbers 0-9 - and Morse code - dots "." and dashes "-"

  What type of testing strategy would you recommend to a start

What type of testing strategy would you recommend to a start-up that is doing very well on the near-global stage? Justify your response.

  After reading about attacks on servers similar to the ones

1.after reading about attacks on servers similar to the ones used in one of your companys departments the cio has asked

  Design and implement a set of classes

Design and implement a set of classes that define the employees of a hospital: doctor, nurse, administrator, surgeon, receptionist, janitor, and so on.

  Write a new queue function called move-to-rear

Write a new queue function called move_to_rear that moves the element currently at the front of the queue to the rear of the queue.

  Why the client receives both the web page

assume you click on a link within your Web browser to obtain a Web page. The IP address for the associated URL is not cached in your local host, so a DNS look-up is necessary to obtain the IP address.

  What are the risks in stressing only one corner of triangle

What are the risks in stressing only one corner of the triangle? How would you have managed this project? Can you think of another approach that might have been more effective?

  Write down a program tht reads this information

People from three different income levels, A, B, and C, rated each of two different products with a number 0 through 10. make a file in which each line contains the income level and product rankings for one respondent.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd