❔ For loops, for this project.

This Project needs me to create a table with a loop of data for the input altitude. Where I'm having a problem is the loop only shows the second value on not the first one. I realize this is because it is I + interval but the alternate is just putting altitude there and that just repeats the initial altitude without adding the interval every time. Also if you know of a easy way to implement a table that would be nice as well. I included my .cs file also.
21 Replies
phaseshift
phaseshift2y ago
On mobile the code files don't get displayed. Suggest pasting. $code
MODiX
MODiX2y ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat If your code is too long, post it to: https://paste.mod.gg/
suddenly_toast
$codegif
suddenly_toast
BlazeBin - lduxiqvipytc
A tool for sharing your source code with the world!
phaseshift
phaseshift2y ago
Who is teaching you to write code like that?
suddenly_toast
a online professor lol
phaseshift
phaseshift2y ago
Figures. Looks like it's from the 80s
suddenly_toast
i cant use var btw one of the rules he is like late 50s early 60s
sibber
sibber2y ago
lmao
suddenly_toast
some of it is my mess though bc he gives examples that only have like 1/2 the material we would be using then we kinda have to figure the rest out.
phaseshift
phaseshift2y ago
Which variable has the problem? Altitude looks like it starts from the low ok But some of then you use i + interval
suddenly_toast
so say you put altitude in at 0 interval 500 and max 11000 it starts at 500 not 0
phaseshift
phaseshift2y ago
Well yeah... You write i+ interval when printing it
suddenly_toast
yeah how would i do that with out doing that if that makes any sense
phaseshift
phaseshift2y ago
Just use i
suddenly_toast
like i know what is causing the problem but im not versed in this code to know what to put there to get my desired result i tried and it just doees not repeat oh wait a sec are you saying use i not i plus intervle omg im an idiot THANKYOU!!! but the 2nd part of that question what is a good way to implement a table format if later I will have to print to text document\
phaseshift
phaseshift2y ago
At this level, probably just a List of strings that you want to print
suddenly_toast
how might I write that?
phaseshift
phaseshift2y ago
Google c# list
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.