Skip to content

Latest commit

 

History

History
84 lines (76 loc) · 3.87 KB

README.md

File metadata and controls

84 lines (76 loc) · 3.87 KB

Train

Created a train as a custom doubly linked list where users can add/remove train cars, update products on a specific train, and display information in various formats.

Description

Remember when we used to play with trains/cars (toys)? We used to put stuff on cars and make them travel through the house. It's fun, right? Would you like to play with it again? Well, this project can help you with that. Instead of playing with a physical toy car, this project would allow you to build a text-based train car. Initially, you would have an empty train. There will be a menu listing all the available commands. You can add a custom train car by calling the insert command, where you have to provide information such as the weight and length. After the insertion, you may put products on the train. It can be apples, gold, or even Hydrogen bombs. Of course, if you no longer need a specific train car, you can delete it by moving to that car and calling the remove command. In conclusion, when running this program, you're the God Of Creation, controlling how the train appears.

Functionalities of the program:

  • Insert train car
  • Remove train car
  • Move to the previous/next train car
  • Update product load
  • Search for a specific product
  • Display train/manifest
  • Remove dangerous cars

Get Started

Dependencies

Installing

Download the src directory

Or

Do the following:

  1. Fork this repository by clicking the Fork button located on the top of the page
  2. Navigate to "Your Repositories" on GitHub and open the forked repo
  3. In the terminal, git clone the repo using the URL or SSH key
Reference: https://docs.github.com/en/get-started/quickstart/fork-a-repo

Executing program

Run directly in IDEs

Or

Do the following in the terminal (the following example is run in the Windows PowerShell):

  1. Check if Java is installed on your computer
  2. C:\Users\anon> java -version
    If installed, it should display the Java version. If an error is presented, download Java from Orcale.

  3. Check if you can access the Java compiler
  4. C:\Users\anon> javac
    It should display some information about the compiler. If not, Follow the steps on this site.

  5. Change the directory to the one that contains your Java files. Let's call this directory "JavaProgram"
  6. C:\Users\anon> cd JavaProgram => C:\Users\anon\JavaProgram>

  7. Compile the file you want to execute. Let's call this file "RunMe.java"
  8. C:\Users\anon\JavaProgram> javac RunMe.java
    This will create the class file "RunMe.class."

  9. Run the program
  10. C:\Users\anon\JavaProgram> java RunMe.java

Author

Zhen Wei Liao - @Zhen

License

This project is under the MIT License.
Please check the LICENSE.md file for more information.