Write program that uses a linkedlist object to store a list

Assignment Help JAVA Programming
Reference no: EM131323857

Assignment: Introduction to Programming Using Java

1. Write a program that uses one of the Map classes to implement a contact list. Contact information should include first name, last name, a phone number and an email address. The list should be stored on your computer's file system and entries sorted alphabetically according to a person's last name. The program should prompt the user for the name of the file where the information is stored, and allow the user to add a contact from the list, delete a contact from the list, and display the entire contact list.

2. A print queue is a list of documents, called jobs, waiting to be printed. Each job is assigned an integer job number and an estimated print time, in seconds. If a job arrives and the printer is currently printing another job, the job waits in the print queue. This type of waiting line is called a first-in-first-out (FIFO) or first-come-first-serve (FCFS) waiting line model or queue. The Java LinkedList class is a pretty good class for implementing a waiting line model like this in code.

Write a program that uses a LinkedList object to store a list of print jobs in a FIFO queue. We will assume that each job has a unique job number that is assigned sequentially, and that the print time is randomly distributed between 10 seconds and 1000 seconds. These two data elements should be defined as part of a Job class. The program should prompt the user to either add a job to the queue or to quit. When a user adds a job, the program assigns a job number and randomly generates a print time for the job. When the user quits, the program will display the jobs (i.e., the job id and print time) in the queue, in the order in which they were added.
For this exercise, you can use the java.util.Random class to generate random numbers, as follows:

Random rnGenerator = new Random( rnSeed ); // creates a Random object printTime = rnGenerator.nextInt( 1000 ) + 10; // next int in range 10-1000.

The first statement above instantiates a Random object called rnGenerator. The constructor argument rnSeed is called a random number seed. It is of type long, and is used to help ensure that the same sequence of random numbers is generated each time the program is run...which is helpful for test purposes. The nextInt() method returns a random integer in the range 0 to 999.

Reference no: EM131323857

Questions Cloud

Write the paper on domestic violence : Write the given paper assignment.- The topic is: "Domestic Violence: The After-Effects."- Also provide the Thesis statement.
Calculate the molarity of solution : Dr. Pepper has 40.0g of sugar per 12 oz. of liquid. Calculate the molarity of this solution. Put that molarity into your regression line and calculate the density (all other things being equal) of this sugar solution. Show your work
Probelm regarding the buffer solution : What mass of NaH2PO4 must be added to 1.20 L of 0.20 M Na2HPO4to make a buffer solution whose pH=6.90? pKa2(H3PO4)=7.21.
Why does the temperature of a solution increase : Why does the temperature of a solution increase if the reaction is exothermic? For example, in the precipitation of silver iodide, delta H is -110.7 kj. Why is this reaction exothermic and why does it cause the solution temperature to increase?
Write program that uses a linkedlist object to store a list : Write a program that uses a LinkedList object to store a list of print jobs in a FIFO queue. We will assume that each job has a unique job number that is assigned sequentially, and that the print time is randomly distributed between 10 seconds and..
Determine the mass of glucose : Determine the mass of glucose, C6H12O6(s), needed to produce a 0.150m glucose solution in 50.0mL of C2H5OH(l), density 0.789g/mL
Frequency of the first harmonic on the string : Consider a string with a length of 54.5 cm tied at both end (like on a stringed instrument). If the frequency of the first harmonic on the string is 256 Hz, determine the speed of the wave in the string. Post your answer in m/sand with 3 significa..
In what ways are worldviews and ethics related : According to your textbook readings, what dynamics exist between an ethical system and the underlying worldview (comprising people's assumptions, beliefs, and actions about reality)? In what ways are worldviews and ethics related? Cite your source..
Frequency of the third harmonic for the pipe : Consider a pipe with a length of 43.5 cm. If the temperature of the air is 19.5 oC and the pipe is closed in one end and open in the other, what is the frequency of the third harmonic for the pipe? Post your answer in hertz (Hz) and with 3 signifi..

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Write a test program that prompts the user

Write a test program that prompts the user to enter a sequence of numbers ending with 0, and invokes this method to return the largest number in the input

  Write java program that calculates total order for customer

Write a Java program that calculates the total order for a customer. The order should include the details of buying several products. For each product (item), there should be a product code, product price, product description, and product icon.

  Create an array of date objects

Create an array of Date objects of size 4. Initialize the array by using a loop. In the loop, use the Scanner.nextLine() method to input a date as a string, convert it to a date by using the toDate() method, and assign the result to an element in ..

  Alter the prototype form page by javascript function

Alter the prototype form page so that when JavaScript function has verified that all the required fields have been filled, cookie is added to user's computer.

  Write a program that establishes two savings accounts

Write a program that establishes two savings accounts with saver1 having account number 10002 with an initial balance of $2,000, and saver2 having account 10003 with an initial balance of $3,000

  Represent relationship between the students and the courses

1. Implement relationship using a java program. Assume each course has a course title, code, subject and number of credits while each student has a name, registration number, list of courses that the student follows and the marks for each course.

  Java problem - g queue

A queue is an ordered collection of items in which the removal of items is restricted to the FIFO ( rst in rst out) principle.

  Create the class airplane

Your missions is to create the class Airplane. Each Airplane object should store the following information (fields):

  Rectangular and cylindrical coordinates

Write a program to convert between rectangular and cylindrical coordinates, based upon user input.

  Implement the structure that maintains a group of items

This class comprises a component of a larger game. You have been asked to implement the structure that maintains a group of items contained within a backpack

  Create a class - constructor for a region

The skeleton provides you with several HTML pages and associated JavaScript and CSS files representing the structure of the app. You will need to implement the logic and functionality for each of these pages - demonstrate how to change from one pag..

  Create a private field to represent each of these states

Create three public classes: one named App, one named Pet and one named PetOwner. The App class has a static void main method that performs all the actions for the Deliverable A and Deliverable B requirements.

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