use a list or array ?

MAGMAM

New member
Joined
Jan 2, 2019
Messages
1
Programming Experience
Beginner
Hello all,


To begin with, this is the first time I deal with C# never learnt it before. I'm going to tell you the whole story then you guys guide me on what to do cuz I'm really kinda lost here.


There is an imaginary schedule I made for obese guys to run in order to lose weight. This schedule is like this:


C#:
           5 Miles                      10 Miles                  15 Miles                20 Miles         and so on
Ham                   *                                                              *
Fish                                                     *                             *
Chicken                                                *                                                       *
Salad                                                                                 *                          *
Juice                   *                               *
Milk                    *                               *                             *                          *


I got a machine that measures the amount of miles/kilometers the obese guy ran. I got a C# program that takes the measurement from the machine and stores the measurements in a database. I should take the measurement (for example the measurement says he ran 5.4 Miles), then compare the 5.4 Miles with the key values (5 Miles, 10 Miles, 15 Miles, 20 Miles) and see the 5.4 Miles falls under which category (it falls under 10 Miles in our case cuz it's greater than 5 Miles), then the C# app/program should show ONLY the values under 10 Miles which are, according to the table, Fish, Chicken, Juice, and Milk. I don't want it to show the whole table.


This is the general view, now technically speaking, I'm quite confused about a few things that need clarification since it's my first time in dealing with C#.


I know this table can be written in some SQL-server and execute the operations there and just send back the result, but I'm preferring to make the whole program in C# since I'm still a beginner in it. Now to make this table, is it possible to make a list or array for the meals then make selections from the array based on the number of miles ran ?.




I'm being squeezed to do this and I'm short in time so please help.


Looking to hear from you guys soon.




Thanks in advance.
 
Back
Top Bottom