Question: Create a console project, create two cs files. Create a Student.cs class ( 5 % ) . Do followings in Student class. Declare these data
Create a console project, create two cs files.
Create a Student.cs class Do followings in Student class.
Declare these data members:
a static int Count.
a private static readonly Random variable rnd
private static readonly Random rnd new Random;
private string firstName, lastName, int sID, create public properties for these three data members.
Two constructors
a Constructor : public Studentstring first string last int id
this constructor set values for firstName, lastName, sID, and increase Count value by
b Constructor : public Studentstring first string last
This constructor set values for firstName, lastName, and increase Count value by
Create StudentID by calling rndNext
Note this constructor is called when
Student s new Student;
Student s new StudentPeter;
Student s new StudentMorgan "Simmons";
Create "Program.cs to have:
Student s new Student;
sFirstName "John";
sLastName "Smith";
sStudentID ;
Student s new StudentPeter;
Student s new StudentMorgan "Simmons";
Student s new StudentJames "Walters";
Student s new StudentLinda "Scott", ;
Console.WriteLine;
Console.WriteLineTotal students: Student.Count;
use Console.WriteLine to display s s s s s Name and Student ID
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
