Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

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. This program counts 65% of the Correctness grade.

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(991) + 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.

Java, Programming

  • Category:- Java
  • Reference No.:- M92394066
  • Price:- $55

Priced at Now at $55, Verified Solution

Have any Question?


Related Questions in Java

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Operating systems assignment -problem 1 sharing the bridgea

Operating Systems Assignment - Problem 1: Sharing the Bridge A new single lane bridge is constructed to connect the North Island of New Zealand to the South Island of New Zealand. Farmers from each island use the bridge ...

In relation to javaa what is constructor the purpose of

(In relation to Java) A. What is constructor? the purpose of default constructor? B. How do you get a copy of the object but not the reference of the object? C. What are static variables and instance variables? D. Compar ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assessment database and multithread programmingtasktask 1

Assessment: Database and Multithread Programming Task Task 1: Grade Processing University grading system maintains a database called "GradeProcessing" that contains number of tables to store, retrieve and manipulate stud ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Assignment taskwrite a java console application that allows

Assignment task Write a java console application that allows the user to read, validate, store, display, sort and search data such as flight departure city (String), flight number (integer), flight distance (integer), fl ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

Project descriptionwrite a java program to traverse a

Project Description: Write a java program to traverse a directory structure (DirWalker.java) of csv files that contain csv files with customer info. A simple sample in provided in with the sample code but you MUST will r ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

  • 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