This repository contains solutions to various exercises from the "Intro to Computer Science" course taken during the first semester of my Computer Science degree. Each exercise explores different fundamental programming concepts using Java, including recursion, basic algorithms, object-oriented design, and file handling.
This exercise enhanced a geometric painting application. The project involved:
- Adding new geometric shapes: rectangles and hexagons.
- Implementing file save/load functionality for shapes.
- Shape sorting by perimeter and allowing for the drawing of sorted shapes on a GUI using Java's Swing framework.
File: Ex4.java
See Full Description at java_ex4.pdf
In this task, the focus was on image manipulation. The program allows reading an image, processing it, and saving it back. Key operations include:
- Grayscale conversion using RGB values.
- Image rotation by 90 degrees.
- Image smoothing through a blur filter.
File: Ex2.java
See Full Description at מטלה 2 - עדכון סופי.pdf
This exercise consisted of two main parts:
- String manipulation: Functions to split sentences into words, create a sorted dictionary of unique words, and handle text processing without using Java’s built-in utilities like
split
. - Object-oriented programming: Implementing a class to handle rational numbers (
Rational
) with functionality for arithmetic operations, comparison, and simplification.
File: Ex3.java
and Rational.java
See Full Description at Ex3.pdf
In this exercise, we explored iterative and recursive number processing techniques. The tasks involved:
- Summing the digits of a number iteratively until a single digit is obtained.
- Checking if a number is "excessive", where the iterative sum of squares of its digits reaches 1.
- Palindrome check to determine if a number is symmetrical.
- Solving the Josephus problem using a mathematical formula.
File: EX1.java
See Full Description at Ex1.pdf
To run the programs:
- Clone this repository.
git clone https://github.com/elilfry/Intro_To_Programming_Java.git
- Compile the Java files using the Java compiler.
javac EX1.java
- Run the compiled classes.
java EX1
Make sure you have Java installed in your system to compile and run the code.