0

about C# write in “window form”

Hello guys I meet a question here. Write the C# code for the bellow condition : An array of raw scores for 10 students without user input In the array, the first student is No. 1, and so on. The topic will explain, for example: Student No. 3 spoke twice. Add 2 points for each speech, calculate the score after the score

26th Apr 2018, 2:57 PM
陳昱堂
陳昱堂 - avatar
1 Answer
0
class Student { public string Name{get;set;} public int Score{get;set;} public int SpeachCount{get;set;} public Student(string name) { Name = name; Score = 0; SpeachCount = 0; } public void RecalculateScore(int multiplier) { Score = SpeachCount * multiplier; } } in some of your method you create array of Students. Student[] arr = new Student[10]; arr[i].Name you need add all students.Then change SpeachCount. And then in for cycle call methot arr[i].RecalculateScore(2);
27th Apr 2018, 2:28 PM
Андрій Сотніченко
Андрій Сотніченко - avatar