C
C#•13mo ago
Takeoff

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
No description
No description
7 Replies
Google
Google•13mo ago
Looks fun!
phaseshift
phaseshift•13mo ago
First, figures out the algorithm, if you can write some pseudo code then someone will help you with the c#
Google
Google•13mo ago
Figure out a way to generalize the relationship between rows in paper Then you can translate it to C#
Takeoff
TakeoffOP•13mo ago
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
No description
Takeoff
TakeoffOP•13mo ago
The other things are already premade by thr teacher all i need to do is check and fill in the missing values(-1)
TxMasterG
TxMasterG•13mo ago
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.
DeepInside
DeepInside•13mo ago
column <= row 🤔
Want results from more Discord servers?
Add your server