C# How to create a generic list of students and grades and access those -


I'm struggling with something on C # which should be really easy for me in an unknown number of students Storage system is needed and unknown number of features about each student are required.

I am basically finding an unknown number of students, grades and other information which is different from any other student. Student 1: Name: John Last Name: DOE Math 1010: A Math 2020: B Math 3010: B + England 1010: A - < Li>

Student 2: name: April: last name: Johnson Geology 1000: C. Math 1010: b etc. ...

Finally, let me each student Need to take steps through and produce your information.

I found this example which is good for a set of known items per student, but I think that I need a list for each student, and I'm not sure that the "master" list How to make it I can understand it for arrays, but the working generator is new to me.

  list & lt; Students & gt; LstStudents = New list & lt; Students & gt; (); Student objStudent = new student (); ObjStudent.Name = "Silver"; ObjStudent.RollNo = 1; LstStudents.Add (objStudent); ObjStudent = new student (); ObjStudent.Name = "Sam"; ObjStudent.RollNo = 2; LstStudents.Add (objStudent); // Luping (student stस्ट in alestustants) through the list of students {// No need to type because the compiler already knows that everything inside this list // is a student console.Vrightline ("roll # "+ CurrentStell Rollo +" "+ Current ST.Name); }  "post-text" itemprop = "text"> 

You can declare as a student class:

  public class student {Private Redoni Dictionary & lt; String, Object & gt; _customProperties = New Dictionary & lt; String, Object & gt; (); Public dictionary & lt; String, Object & gt; Custom Properties {Back {_customProperties; }}}   

and then use it:

  list & lt; Students & gt; LstStudents = New list & lt; Students & gt; (); Student objStudent = new student (); ObjStudent.CustomProperties.Add ("name", "silver"); ObjStudent.CustomProperties.Add ("RollNo", 1); LstStudents.Add (objStudent); ObjStudent = new student (); ObjStudent.CustomProperties.Add ("name", "Sam"); ObjStudent.CustomProperties.Add ("RollNo", 2); LstStudents.Add (objStudent); Foreign Language (studio status in list students) {Forchach (in current students corporate properties) • Console Virline (Prk + K + "+ PrP value);}}    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -