namespace students
{
class Student
{
private int idNumber;
private string lastName;
private double gradePointAverage;
public const double HIGHEST = 4.0;
public const double LOWEST = 0.0;
public int IdNumber
{
get
{
return idNumber;
}
set
{
idNumber = value;
}
}
public string LastName
{
get
{
return lastName;
}
set
{
lastName = value;
}
}
public double GradePointAverage
{
get
{
return gradePointAverage;
}
set
{
if(value >= LOWEST && value <= HIGHEST)
{
gradePointAverage = value;
}
else
{
gradePointAverage = LOWEST;
}
}
}
}
}
and the driver looks like this:
using System;
namespace students
{
public class CreatingStudents
{
public static void Main()
{
Student first = new Student();
Student second = new Student();
first.IdNumber = 123;
first.LastName = "Anderson";
first.GradePointAverage = 3.5;
second.IdNumber = 789;
second.LastName = "Daniels";
second.GradePointAverage = 4.1;
Display(first);
Display(second);
}
public static void Display(Student stu)
{
Console.WriteLine("{0,5}{1,-10}{2,6}",
stu.IdNumber, stu.LastName, stu.GradePointAverage.ToString("F1"));
}
}
}
I can't compile the CreatingStudents class without compiling the Students class first, but when I try to compile "csc Student.cs" I get this error:
Quote
'directory/Student.exe' does not contain a static 'Main' method suitable for an entry point.
Any help"?


Sign In
Create Account


Back to top









