UNIVERSITY OF WEST ATTICA
SCHOOL OF ENGINEERING
DEPARTMENT OF COMPUTER ENGINEERING AND INFORMATICS
Object-Oriented Programming
Vasileios Evangelos Athanasiou
Student ID: 19390005
Supervision
Supervisor: Cleo Sgouropoulou, Professor
Co-supervisor: Georgios Meletiou, Laboratory Teaching Staff
Athens, June 2022
This repository contains a C++ program that demonstrates the use of structures, dynamic memory allocation, and pointers to manage information about Avengers characters. Users can read, process, and display various statistics, calculate averages, and identify the strongest Avenger based on different criteria.
| Section | Folder/File | Description |
|---|---|---|
| 1 | assign/ |
Assignment material for the Intro workshop |
| 1.1 | assign/Exercise1.png |
Exercise description in English |
| 1.2 | assign/Άσκηση1.png |
Exercise description in Greek |
| 2 | src/ |
Source code files for introductory exercises |
| 2.1 | src/Intro.cpp |
C++ source code for the introductory exercise |
| 3 | README.md |
Project documentation |
| 4 | INSTALL.md |
Usage instructions |
The program allows:
- Reading and storing Avengers’ attributes
- Calculating maximum and average statistics
- Printing character details
- Identifying the strongest Avenger
- Working with a 2D matrix of integers for additional functionality
- Allocates memory for an array of
Avengersstructures dynamically to efficiently store user-defined numbers of characters.
- Defines properties of Avengers including: name, intelligence, leadership, outfit, powers, and damage.
- Read and store Avengers’ attributes
- Compute maximum and average statistics
- Print details of Avengers
- Identify the strongest Avenger
- Work with a 2D matrix of random integers
- Functions to check and free dynamically allocated memory, ensuring no memory leaks.
| Function | Description |
|---|---|
Change_Const() |
Demonstrates pointer manipulation with constants |
Read_Avengers() |
Reads data into an array of Avengers |
Max_Stats(const Avengers *, string &, const int) |
Returns maximum statistics and corresponding Avenger |
Avg_Stats(const Avengers *, const int) |
Computes average statistics |
Print_Avg_Stats(...) |
Prints average statistics for given inputs |
Search_Lowest_Even(...) |
Finds the lowest even number in a 2D matrix |
Append_Characters(...) |
Demonstrates default parameter usage by appending characters |
Example Use Cases:
- Managing and analyzing superhero statistics
- Performing operations based on user-defined input for character attributes

