Skip to content

A collection of single-file programs written in Java

Notifications You must be signed in to change notification settings

plu28/java-collection

Repository files navigation

java-collection

A collection of my single-file Java solutions

BookAppVoronov.java

This program is a Java application for a BookStore that allows the user to add, delete, and sort books based on different criteria such as title, author, or price. The program includes a Book class that represents a book with its title, author, ISBN, and price, as well as several methods for comparing and manipulating books.

ContactAppVoronov.java

A Java application for a contact list that allows the user to add, delete, and search for contacts. The program includes a Person class that represents a person with their first name, last name, and phone number, as well as several methods for comparing and manipulating people. The program also includes a Contact class that creates and stores a list of Person objects and provides methods for adding, deleting, and searching for contacts.

MovieAppVoronov.java

A Java application for a movie list that allows the user to add, remove, and search for movies. The program includes a Movie class that represents a movie with its name, genre, rating, and views, as well as several methods for comparing and manipulating movies. The program also includes a List interface and a MovieList class that implements the interface and provides methods for adding, removing, and searching for movies in a linked list. The MovieList class also includes a size method to return the number of movies in the list and a get method to return a movie at a given position.

Payroll.java

A Java application for managing payroll information for multiple employees. The program includes a Payroll class that represents an employee with their name, ID, hourly rate, and hours worked, as well as several methods for getting and setting employee information and calculating their pay. The program also includes a PayrollDriver class that creates and tests Payroll objects using the provided main method.

QueueVoronov.java

This program creates a queue data structure using an ArrayList and implements various methods to enqueue and dequeue elements, get the minimum and maximum elements, reverse the order of the queue, and find the average of all elements in the queue.

RecursiveHomework.java

The program contains a main method with tests for five recursive methods: palindrome, sum, longest, equals, and listSum. The palindrome method returns whether or not an array of integers is a palindrome. The sum method returns the sum of the digits in a given integer. The longest method returns the longest string in an array of strings. The equals method returns whether or not two strings are equal. The listSum method returns the sum of the integers in a linked list.

StarFigure2.java

This program creates a series of rows of backslashes, asterisks, and forward slashes, with each row increasing in asterisks and decreasing in backslashes and forward slashes. The final output creates a star shape with a total of 10 rows.

Stdev.java

This program calculates the standard deviation of an array of integers.

TrainProjectStudents.java

This Java application defines classes for a train project including a Person class, a Passenger class that extends Person, and a Train class that implements a list interface. The Person and Passenger classes contain instance variables and methods for storing and accessing information about a person's name, phone number, email, and in the case of the Passenger class, seat class and seat number. The Train class contains an array of Passengers and methods for adding, searching for, and deleting Passengers, as well as printing the last Passenger added to the train.

TriangleArea.java

This program uses Heron's formula to calculate the area of a triangle given the lengths of its sides.

tic_tac_toe.java

This Java program is a text-based implementation of the game Tic-Tac-Toe. It includes a method for printing the game board, methods for allowing players to place their symbols on the board, and methods for checking if a player has won the game or if the game has resulted in a tie. The program also includes a method for getting player names and a method for rotating turns between players. The game is played on a grid of characters with the players represented by the symbols 'X' and 'O'. The game ends when either a player has placed three of their symbols in a row, column, or diagonal, or all spaces on the board have been filled with no winner.

About

A collection of single-file programs written in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages