Answer to Question #4812 in C# for lakshya

Question #4812
want some help regarding my project in c language using mainly pointers & arrays about STUDENT INFORMATIONS it shuld include their names, their parents name, their roll no., corse sode , section, and their attendence...... plz if posssible give examples with some students..... so i could edit it later time with my claz mates name.......... or i wont be knowing where to edit
1
Expert's answer
2011-10-25T08:22:47-0400
using System;
using System.Collections.Generic;
using
System.Linq;
using System.Text;

namespace
StdInformation
{
public class Student{
private string
names;

public string Names
{
get { return names; }
set { names =
value; }
}
private string parentsname;

public string
Parentsname
{
get { return parentsname; }
set { parentsname = value;
}
}
private string roll;

public string Roll
{
get { return
roll; }
set { roll = value; }
}
private string corsesode;

public
string Corsesode
{
get { return corsesode; }
set { corsesode = value;
}
}
private string section;

public string Section
{
get {
return section; }
set { section = value; }
}
private string
attendence;

public string Attendence
{
get { return attendence;
}
set { attendence = value; }
}
public Student() {


}
}
class Program
{

static void Main(string[]
args)
{
Student std1, std2, std3;
std1 = new Student();
std1.Names =
"Peter";
std1.Parentsname = "Peter";
std1.Roll = "rool For
peter";
std1.Section = "Compyter eng";
std1.Attendence =
"Attendence";
std1.Corsesode = "1231232";

std2 = new
Student();
std2.Names = "Bred";
std2.Parentsname = "Peter";
std2.Roll =
"rool For peter";
std2.Section = "Compyter eng";
std2.Attendence =
"Attendence";
std2.Corsesode = "454554";

std3 = new
Student();
std3.Names = "Peter";
std3.Parentsname = "Peter";
std3.Roll
= "rool For peter";
std3.Section = "Compyter eng";
std3.Attendence =
"Attendence";
std3.Corsesode = "423434";
List<Student> listStudent =
new
List<Student>();
listStudent.Add(std1);
listStudent.Add(std2);
listStudent.Add(std3);

foreach
(var std in listStudent) {

Console.WriteLine(std.Names + " " +
std.Parentsname + " " + std.Attendence + " " + std.Corsesode + " " + std.Roll +
" " + std.Section);

}
Console.ReadLine();
}
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS