This repository contains assignments developed in Pharo, focusing on matrix conversion (traditional to sparse and vice versa) and generating Java-like documentation for Pharo packages.
# Task Documentation ## Overview This repository contains two exercises implemented in Pharo, as part of the requested task. The exercises focus on different aspects of the programming process and include test cases to validate the correctness of the functionalities. ### Exercises 1. **Hollow Matrix Conversion** - A program that converts a traditional matrix (array of arrays) to a sparse matrix (hollow matrix) and vice versa. The hollow matrix representation stores only non-zero elements along with their respective indices, providing a memory-efficient solution for sparse data. 2. **Pharo Documentation Generator** - A program that generates documentation for Pharo classes and packages, similar to JavaDoc. The generated documentation includes class information such as the superclass, subclasses, instance variables, and methods with available comments. ## Exercise 1: Hollow Matrix Conversion ### Description The `MatrixConverter` class provides functionality to convert a traditional matrix (2D array) into a sparse (hollow) matrix and vice versa. - **`convertToSparseMatrix:`** Converts a traditional matrix to a sparse matrix representation. - **`convertToTraditionalMatrix:`** Converts a sparse matrix back into a traditional matrix. ### MatrixConverter Class The `MatrixConverter` class handles the conversion between traditional and sparse matrix formats. Below is the class definition: ```smalltalk Object subclass: #MatrixConverter instanceVariableNames: 'traditionalMatrix sparseMatrix' classVariableNames: '' package: 'HollowMatrix' ``` ### Methods 1. **`convertToSparseMatrix: aTraditionalMatrix`** - Converts a traditional matrix into a sparse matrix representation. 2. **`convertToTraditionalMatrix: aSparseMatrix`** - Converts a sparse matrix back into a traditional matrix. --- ### MatrixConverterTest Class The `MatrixConverterTest` class is a unit test class that ensures the correctness of the `MatrixConverter` methods. Below is the class definition: ```smalltalk TestCase subclass: #MatrixConverterTest instanceVariableNames: '' classVariableNames: '' package: 'HollowMatrix' ```  ## Exercise 2: Pharo Documentation Generator ### Description The `PharoDoc` class generates documentation for Pharo classes and packages, mimicking the functionality of JavaDoc but specifically for the Pharo environment. - **`classesInPackage: packageName`**: Returns all classes in a given package. - **`documentClass: aClass`**: Generates documentation for a single class, including its superclass, subclasses, instance variables, and methods. - **`documentPackage: packageName`**: Generates documentation for all classes in a package. ### PharoDoc Class The `PharoDoc` class generates structured documentation for Pharo classes and packages. Below is the class definition: ```smalltalk Object subclass: #PharoDoc instanceVariableNames: 'package' classVariableNames: '' package: 'PharoDoc' ``` ### Methods 1. **`classesInPackage: packageName`** - Retrieves and lists all classes in the specified package.  2. **`documentClass: aClass`** - Documents the given class, including details such as its superclass, subclasses, instance variables, and methods.  3. **`documentPackage: packageName`** - Documents all the classes within a specified package.   ## Test Class: PharoDocTest The `PharoDocTest` class verifies the functionality of the `PharoDoc` class. ### PharoDocTest Class ```smalltalk TestCase subclass: #PharoDocTest instanceVariableNames: '' classVariableNames: '' package: 'PharoDoc' ```  ## Under Development The `MatrixConverterApp` is currently under development. This application will provide a user-friendly interface to interact with the `MatrixConverter` class and its methods. I will push it to this repository as soon as it is completed.  ## Installation To run the code and tests , Clone this repository: ```bash git clone https://github.com/yosrak5/Pharo-assignments.git ```