C-CPP-Programming icon indicating copy to clipboard operation
C-CPP-Programming copied to clipboard

New feature in c++ project cgpa

Open dawitbeza opened this issue 1 year ago • 4 comments

I have contributed to the CGPA Calculator C++ project by addressing several issues and making improvements.

Firstly, I fixed a bug related to the use of variables for array initialization, such as int name[q]. This caused the program to fail, as array sizes must be constant expressions known at compile-time. To resolve this, I replaced these statically sized arrays with dynamically sized arrays using vectors.

Secondly, I refactored the code by replacing all goto statements with while loops. The use of goto is generally discouraged in modern programming due to its impact on readability and maintainability.

Finally, and most importantly, I added a new InputValidation function. This function ensures that user inputs are validated based on specified upper and lower bounds as well as the correct data type. The program will now continue prompting the user until a valid input is entered.

dawitbeza avatar Oct 18 '24 11:10 dawitbeza