Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace class_ex
{
class Program
{
static void Main(string[] args)
{
student s = new student();
student s1 = new student();
Console.WriteLine("\n\n Reading First Student Record :");
s.read_rec();
Console.WriteLine("\n\n Reading Another Student Record :");
s1.read_rec();
Console.Clear();
Console.WriteLine("\n\nStudent Record ");
s.line();

s.display_rec();
s.line();
s1.display_rec();

Console.ReadKey();
}
}
class student
{
string stuno, name, course, year;
public void read_rec()
{
Console.Write("Enter student no :");
stuno = Console.ReadLine();
Console.Write("Enter student name :");
name = Console.ReadLine();
Console.Write("Enter student course :");
course = Console.ReadLine();
Console.Write("Enter student year :");
year = Console.ReadLine();

}
public void display_rec()
{
Console.WriteLine(" Name :"+name);
Console.WriteLine(" Stu_No :"+stuno);
Console.WriteLine(" Course :"+course);
Console.WriteLine(" Year :"+year);
}
public void line()
{
Console.WriteLine();
for(int i=0;i<15;i++)
{
Console.Write("*");
}
Console.WriteLine();
}
}
}

You might also like