Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student
- {
- public string Name { get; set; }
- public int Age { get; set; }
- public char Grade { get; set; }
- public Student()
- {
- }
- public Student(string name, int age, char grade)
- {
- Name = name;
- Age = age;
- Grade = grade;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Student student = new Student();
- Console.Write("Enter student's name: ");
- student.Name = Console.ReadLine();
- Console.Write("Enter student's age: ");
- student.Age = Convert.ToInt32(Console.ReadLine());
- Console.Write("Enter student's grade: ");
- student.Grade = Convert.ToChar(Console.ReadLine());
- Console.WriteLine("\nStudent Information:");
- Console.WriteLine("Name: " + student.Name);
- Console.WriteLine("Age: " + student.Age);
- Console.WriteLine("Grade: " + student.Grade);
- Console.ReadLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement