Create an application to simulate a Train Scheduler

Assignment Help JAVA Programming
Reference no: EM132307337

Project - Linked List Train Application

You're going to create a linked-list and an application to simulate a Train Scheduler.

You're going to have a menu with the following selections:

1) Add a car to the train.

2) Add a car to the back of the train.

3) Add a car to the train at a specific position.

4) Remove the first car from the train.

5) Remove the last car from the train.

6) Remove a car from the train at a specific position.

7) View the train and all of its cars.

8) View all of the removed cars.

9) Remove all of the train's cars.

10) Exit

You're going to create a Node class with the following properties: 

String   cargo 

Node   next          for next node (or what it's pointing to)

If the user asks to add a new car you're going to prompt them for the cargo.

Regardless of where they'd like to add the car. Keep prompting them until they give you a valid string.

When a user asks to add a car to the front then add it to the front.

If they ask to add it to the back then add it to the back. You'll have a method for each of these.

If they ask to add it to a specific position, you're going to list the available choices for them. So, if there are three cars and they select the menu option 2 for adding it to a specific location you're going to ask them if they'd like to add from 0 to 4. One would be in front of the head car. 2 would be in between the first and second car. 3 would be in between the second and third car. And 4 would be at the back. If they choose anything else then keep prompting them until they enter a correct position.

You will then add accordingly. So, a 1 would again call the method to add to the head. A 4 (or whatever the last position is) would call the method to add it to the back of the train. Otherwise you'll add it at the position they are asking for.

Same with removal. Remove from front, Remove from back, Remove from position. When you remove the car you're going to add it to a second linkedlist called removedCars. Don't worry about positioning, just add them to the back.

The view the train will display all of the cars with their cargo and position in a neatly formatted way.

The view removed cars will display all of the removed cars and their cargo, not position.

The empty train selection will remove all of the cars placing them in the removed cars linked-list in order from front to back as they were in the train.

The last selection will exit the program.

Note - This have to be done in Dr.java as well as netbeans.

Attachment:- Assignment File.rar

Reference no: EM132307337

Questions Cloud

Illustrate and verbally express a personal transformation : Multimodal Personal Narrative - Develop a multimodal document to both visually illustrate and verbally express a personal transformation.
Construct a letter focused on persuading the reader : Construct a letter focused on persuading the reader to change his or her stance or opinion.
Write buffer in mmu helps to avoid controller : a) Write buffer in MMU helps to avoid controller stall upon cache miss during write using write through policy
Allow the aggregate of the virtual machines : Does this allow the aggregate of the virtual machines to perform more real work than a physical workload would be capable of on the same hardware?
Create an application to simulate a Train Scheduler : CISS 111 Project - Linked List Train Application. You're going to create a linked-list and an application to simulate a Train Scheduler
What is the total size of cache memory in kb unit : It uses 22-bits TAG and 10-bits 'Ctrl' bits. What is the total size of cache memory in KB unit? Please provide explanation
How would you have defined the term culture : Dr. Banks also names what he calls the five basic types of knowledge. Based on this list, which are the most influential types of knowledge in your opinion? Why
Briefly describe three examples of aristotles golden mean : Would we in the 21st century consider many of the issues of these examples moral issues or merely character development goals?
How many active processes are there at this time : In a computing system deploying virtual memory, there are 1M (2^20) page table entries per process. Each entry has 48 bits

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a static method to check the string

The max() method cannot read any input values, nor print any output values. All input and printing is done by the main() method that calls max().

  Write a program that determines the day of the week

You are to write a program that determines the day of the week for New Year's Day in the year 3000. To do this, you must create your own date class (MyDate) and use the following interface and main program.

  Design an algorithm that creates the table c

Design an algorithm that creates the table C according to the above description and has time complexity Theta(m^2).In response give either pseudocode or the description of the steps of the algorithm, and justify the time complexity.

  Implements both the quicksort and mergesort algorithms

Write a program that correctly implements both the Quicksort and Mergesort algorithms. The program should generate an array of 500 random numbers in the 1-100 range. The program should sort the same set of numbers and keep time stamps of how long it ..

  Write a program that will simulate this vending machine

Write a program that will simulate this vending machine. First, accept coins from the user until the user enters zero.

  What is the output of the following program explain

What is the output of the following program? Explain. Explain the meaning of the reserved word this and why it is necessary in the class below. Will the class compile without using this

  Create a constructor in the subclass why

Assume there is a base class with multiple constructors, if the subclass inherits from the base class, do we need to create a constructor in the subclass? Why?

  Java program which handles events from different sources

how to setup a program to respond to events from any one of these sources. How do you create the necessary listener class? How do you associate the listener object with the event source?

  Create a time design

Create a time design. The requirements are as follows: Clock system must be self-contained object that can be instantiated, and given start, pause, fast forward, and slow down settings

  Write a java program to play game of lightsout

Write a java program to play game of LightsOut - prepare a java program to play the game of lightout.

  Create an array of creditcard objects

Create an array of CreditCard objects, populate and display the values. You will not be changing your CreditCard class, but you will have to submit it

  Develop a java console application using the netbeans

COIT20245 - Introduction to Programming - Central Queensland University - develop a Java console application using the NetBeans 8.2 IDE.

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