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

  What are the benefits of documenting

What are the benefits of documenting our programs in Java?

  Computer network and data communication

What are the question for computer network and data communication

  Write a program that creates a two-dimensional array

Write a program that creates a two-dimensional (2D) array initialized with test data (for instance, use Random method to prepare an array of integers).

  Problems related to java programming

Create a Java program to do the following: - Open the text file you downloaded. - Read each record.

  Role of setter and getter in mortgage calculator

The setter and getters must stay in MortgageCalculator.java and everything should output from main (Driver.java).

  Program to display the original value

For each value read, your program should display the original value, the number rounded to the nearest integer, the number rounded to the nearest tenth, the number rounded to the nearest hundredth and the number rounded to the nearest thousandth.

  Java script program for song

Construct a JavaScript program that declares and prints an array that includes at least twenty of your favorite songs.

  Calculates the cutoff frequency in a simple rc circuit

Write a simple Java application which calculates the cutoff frequency in a simple RC circuit.

  Tic-tac-toe game assignment

Assignment 1(Java): Tic-Tac-Toe Game (Assignment 1 is attached),  Use the concepts and scenario from Assignment 1 and continue with the tic-tac-toe game design and development.  Section 1: Java Program File, The following method, numPaths, is suppos..

  Write a java program called namecollector

Write a Java program called "NameCollector" that contains an object invocation for a class called "Collector".

  Write a program to print out a simplified bill

Write a program to print out a simplified bill. The customer's name, the number of hours of labor, and the cost of parts and supplies should be entered in response to INPUT statements.

  What steps are involved in your analysis of this problem

Write code to process the 3 possible searches. Sample data is included for testing.

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