Lab help
Hi, i'm a new programmer and i'm stuck on this lab if anyone can help.
Basically, I have to implement a pyramid of additions. The elements of the pyramids are displayed as an array as you can see. I already did the first step which is to implement the triangle in c# as it had an rectangle form before. I basically made nested loops with conditions that says that columns cannot go past rows therefore always resulting in the same values as the rows.
Where i'm stuck is the part where I have to check the question marks and find all the missing numbers to complete the pyramid of additions. The missing arrows are basically replaced with -1, so how do I check each number and find the missing values using c# syntax?
![No description](https://cdn.answeroverflow.com/1178150030910160976/Screenshot_20231125_203652_OneDrive.jpg)
![No description](https://cdn.answeroverflow.com/1178150031182794832/Screenshot_20231125_203734_OneDrive.jpg)
![No description](https://cdn.answeroverflow.com/1178150031488995348/Screenshot_20231125_203645_OneDrive.jpg)
7 Replies
Looks fun!
First, figures out the algorithm, if you can write some pseudo code then someone will help you with the c#
Figure out a way to generalize the relationship between rows in paper
Then you can translate it to C#
heres what i did so far i created this using code it should display the pyramid all i need to do next is to create a function that checks each value that is not equal to -1 and checks weither or not it can add up but im not sure where to start
![No description](https://cdn.answeroverflow.com/1178165837786529842/image.png)
![No description](https://cdn.answeroverflow.com/1178165838054948934/Screenshot_20231125_203734_OneDrive.png)
The other things are already premade by thr teacher all i need to do is check and fill in the missing values(-1)
Slow down for a moment, try solving this on paper first. First, what is a number you can figure out immediately? How did you figure that out? After you have that THEN think about how to describe this in a program.
column <= row
🤔