public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
Welcome to my Java Project Repository!
Here you will find some of my Java projects that I have worked on over the years. These include personal projects and school projects. See below for descriptions of projects if you don't want to go through the repository 😄
Interested in other projects I've worked on not Java-related? Check out my other GitHub Repositories.
- CSCI 1471 - ComputerScience2
-
Area Calculator
This one is just a basic area calculator that calculates the area of circles, squares, and triangles. It takes in user input, such as the type of shape to calculate the area of and the required dimensions, and outputs a shape to the console using asterisks that represents the user's input along with the area. -
Car Trip V2
This project was made to estimate the amount of gas needed for a car trip. It asks the user for the amount of gas in the tank to start with, and using a loop will continue to ask for legs of the trip along with the speed of each leg. At the end, it will calculate whether or not there is enough gas left over for a return trip or if more gas is needed to continue. -
Caesar Cipher
A Caesar Cipher is one of the simplest and most widely known encryption techniques. It can be used to decode/encode simple messages. It is a substitution cipher in which each letter in the plain-text is replaced by some letter some fixed number of positions down the alphabet. For example, given the string 'Caesar' and a shift of 3: C + 3 -> F
A + 3 -> D
E + 3 -> H
S + 3 -> V
A + 3 -> D
R + 3 -> U -
Grade Level
The requirements for this project was to create a program that would calculate the Flesch-Kincaid grade level of a given text. The Flesch–Kincaid readability tests are readability tests designed to indicate how difficult a reading passage in English is to understand. There are two tests, the Flesch Reading Ease, and the Flesch–Kincaid Grade Level. This project calculates the Flesh-Kincaid Grade Level according to the following formula:
-
Palindrome Checker
A palindrome is any string of characters, numbers, or symbols that is spelled the same forwards as backwards. For example, RACECAR, 1234321, !@#%^%#@!
This project lets the user enter any text into a text box and will determine whether the string of text is a palindrome.
-
-
CSCI 3321 - Numerical Methods
-
Approximating the Derivative of using the definition of the derivative (Assignment 1):
-
Approximating a Root of using Bisection Method and Newton's Method (InClassAssignment):
Bisection Method
Check out this link to learn more about the Bisection Method
-
-
CSCI 3352 - Advanced Data Structures
-
Comparison of QuickSort and HeapSort (Program1-NonGUI) This program compares the exection times of the QuickSort and HeapSort algorithms.
QuickSort: The quick sort algorithm is relatively simple. It is broken up into two parts: a recursion method called QUICKSORT and a method that partitions the input array into smaller sub-arrays, called PARTITION.
PARTITION will always select the last element A[r] in the subarray A[p . . . r] as the pivot or the element around which to partition.
Check out this link to learn more about QuickSortHeapSort: The heap sort algorithm is pretty straightforward. (Once you know what a heap is, of course!)
What is a binary heap? Well, in layman's terms, it is simply an array where there is a special relationship between the indices of the elements. If the parent node of the heap is stored at index
i
then the left child can be calculated as being in position2 * i + 1
and the right child is at position2 * i + 2
. The value at indexi
(the parent) is greater than the values in its two child nodes. This defines what is known as a max binary heap. If the parent is smaller than the two children nodes, this is known as a min binary heap. Check out this link to learn more about HeapSort
-
QUICKSORT(A,p,r)
if p < r
q = PARTITION(A,p,r)
QUICKSORT(A,p,q - 1)
QUICKSORT(A,q + 1,r)
where the initial call is QUICKSORT(A, 1, n). n is length of array
PARTITION(A,p,r)
x = A[r]
i = p - 1
for j = p to r - 1
if A[j] <= x
i += 1
exchange A[i] with A[j]
exchange A[i + 1] with A[r]
return i + 1
HEAPSORT
1. Build a max heap from the input data.
2. After building, the largest item is stored at the root of the heap (at index 0). Replace
it with the last item of the heap (at index n-1, where n is length of array).
3. Reduce the size of the heap by 1.
4. Repeat steps 1-3 while the size of the heap is greater than 1.
5. Celebrate! Your array is sorted!
-
Square Apocalypse (Game)
This was a game I made based on a YouTube tutorial I watched. The premise is that you are a circle in a world of squares and you must use your power-ups and the WASD keys to dodge the squares that are coming after you. Some enemies are easy and some are very hard. If you can make it to level 50, there is a boss fight and you get to shoot bullets at the boss! If you can defeat him, you win and have saved the world from those awful squares 😁. Making it to level 50 is no easy challenge though and I really don't think it is doable at this time because of the bugs. Oh well.
The game was made using the built-in Java AWT libraries and a few slick-util libraries for image loading and audio. It was a fun project to work on and I learned a lot about game programming based on this. It's not perfect and there are a lot of bugs that still need to be worked out but I thought it was at least playable (for the most part 😉). I can't remember the exact tutorial that I watched but if you are interested in game programming, just search for "Beginner Game Programming in Java" on YouTube and I'm sure you would find a similar tutorial. -
HailStone Sequence (Mathematics)
The Hailstone sequence is a problem that is found in Douglas Hofstadter’s book Gödel, Escher, Bach which contain's many mathematical puzzles. I solved this problem using a recursive method that would continue to call itself until the base case of n being 1 was met. This problem's algorithm is this:- Pick some positive integer and call it n.
- If n is even, divide it by two.
- If n is odd, multiply it by three and add one.
- Continue steps ii and iii until n is equal one.
-
Hangman (Game)
The classic Hangman game that was coded in just under 2 hours. Definitely not perfect and could use a lot of cleaning up but still, it was fun to make Hangman. Right now, it just selects a random word from a pool of 10 words. Possible implementations include selecting words from a file. This would allow for a larger selection of words and more replay value. Also, I could make the game as a GUI instead of console based. But, I'm happy with what I accomplished in under 2 hours.