Hello again,
I hopefully have a quick and simple question. I'm working with 5 forms to that will be holding data over them and then have the ability to add, delete, edit the data for each person entered into the form (student wise).
So far I've managed to create 2 classes and my 5 forms. I've filled in my student.cs but having trouble with my main.cs (the one that will be taking full control of most of the forms).
student.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace maint_student_scores
{
class student
{
private string name;
private List<int> Scores = new List<int>();
public int scoreTotal()
{
int Total = 0;
foreach (int score in Scores)
{
Total += score;
}
return Total;
}
public int scoreCount()
{
return Scores.Count;
}
public void addScore(int Score)
{
Scores.Add(Score);
}
public void editScore(int Score, int index)
{
Scores.Remove(index);
Scores.Insert(index, Score);
}
public void deleteScore(int index)
{
Scores.Remove(index);
}
}
}
main.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace maint_student_scores
{
class main
{
private List<student> Students = new List<student>();
public Array allStudents()
{
}
public int scoreTotal()
{
}
public int scoreCount()
{
}
public int average()
{
}
}
}
I'm not sure if I did my main.cs correctly in the setup for the array. The way it works is that you enter a student name (or select one that is there), it will then show the Score Total, average, score count (how many scores in the the array) in a text box, I know how to do that, done that in the past and isn't too hard. But I'm confused on how I should be storing the array as a List<student> or should I be storing it someway else?