My third pull request was on another topic that I have not done in a long time. This time I was working with C++. C++ is a general-purpose programming language. It has imperative, object-oriented and generic programming features, while also providing facilities for low-level memory manipulation. I chose to work with C++ because I have a somewhat decent background in the language even though I have not worked with C++ in almost two years. But before that, I was working extensively in C++. I decided to work with C++ for my third pull request because it had been a while since I have used it so I decided to use this pull request as a somewhat refresher in the topic. I’m sure for my next pull request I can work with a language that I haven’t used for my previous two pull requests. The following is the issue that was posted that I decided to work on.
What was being asked from the issue was to add a new file where two two dimensional matrices would add with each other. First I had to review two dimensional arrays. I also had to make sure that if two separate two dimensional arrays that had different dimensions were able to add with each other. After doing research I learned that both two dimensional arrays had to have the same dimensions in order to be added with each other. So first I had to make sure that both two dimensional arrays that are being added are the same dimension. That means if one array was 2×4 the other array had to be 2×4 and not 4×2. I decided that the user should input the numbers of rows and columns to create the dimension of the arrays, which is done in the following image.
After the user enters the dimension of the array, the user must enter values to populate both arrays. I could have set values when the program loads but I figured it would be better if the user would enter their own values. When the user enters their own values, I made sure to display which matrix has values being entered and the position of the value being entered next to the text field. So the values are entered in the following image.
After all of the values are entered, the next field displays the sum of each position after both matrices are added like in the following image.
After making more tests to make sure everything was done correctly, I made the pull request and made sure to reference the issue in the pull request which is done in the following link. I am glad I completed this issue because it has been some time since I’ve worked with C++ and this was a simple refresher in the language. I believe this has been my fourth pull request and working with Git Bash has become natural to me. This assignment has helped when it comes to working with different problems in different languages and making pull requests to GitHub helps when it comes to understanding how the repositories work. The first time I was working with GitHub I was always so confused as to how it all worked but know it is all very simple and easy to understand.