❔ 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
On mobile the code files don't get displayed.
Suggest pasting.
$code
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/$codegif
BlazeBin - lduxiqvipytc
A tool for sharing your source code with the world!
Who is teaching you to write code like that?
a online professor lol
Figures. Looks like it's from the 80s
i cant use var btw one of the rules
he is like late 50s early 60s
lmao
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.
Which variable has the problem? Altitude looks like it starts from the low ok
But some of then you use i + interval
so say you put altitude in at 0 interval 500 and max 11000 it starts at 500 not 0
Well yeah... You write i+ interval when printing it
yeah how would i do that with out doing that if that makes any sense
Just use i
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\
At this level, probably just a List of strings that you want to print
how might I write that?
Google c# list
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.