Dev999
New member
- Joined
- May 20, 2021
- Messages
- 1
- Programming Experience
- Beginner
Hi everyone. I am new to C# and I am trying to solve some basic exercises. I got stuck in this exercise. We have a classs student with two parameters string : Name string : Gender. And we have two list with students. We need to return the number of students males and females but we shpuld use ref to return multiple values in this function. I have done the code below. Can you help me ? I appreciate it.
list:
using System;
using System.Collections.Generic;
namespace ExerciseGeneric
{
class Program
{
public string name;
public string gender;
static void Main(string[] args)
{
List<Student> listStudents1 = new List<Student>()
{
new Student("atr","f"),
new Student("ar","f"),
new Student("rrbr","f"),
new Student("ar","f"),
new Student("atr","f"),
new Student("arr","f"),
new Student("ajr","f"),
new Student("an","f"),
new Student("ytr","f"),
new Student("ktr","f"),
};
List<Student> listStudents2 = new List<Student>()
{
new Student("atr","f"),
new Student("atr","f"),
new Student("atr","f"),
new Student("uyr","f"),
new Student("edr","f"),
new Student("sddfr","f"),
new Student("atxar","f"),
new Student("ytadr","f"),
new Student("usr","f"),
new Student("stfr","f"),
};