TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Maha
NA
0
324k
Build Errors
Nov 29 2011 11:47 AM
This program is compiling well but message box says there were build errors. Please anyone can explain the reason.
using System;
public class CreateStudent
{
public static void Main()
{
Student oneSophomore = new Student();
oneSophomore.SetId(951);
oneSophomore.SetName("Ross");
oneSophomore.SetGPA(3.5);
Console.WriteLine
("The student named {0} has ID # is {1} and a gpa of {2}",
oneSophomore.GetName(), oneSophomore.GetId(), oneSophomore.GetGPA());
Console.ReadLine();
}
}
class Student
{
private int idNumber;
private string lastName;
private double gradePointAverage;
public int GetId()
{
return idNumber;
}
public void SetId(int id)
{
idNumber = id;
}
public int GetName()
{
return lastName;
}
public void SetName(string name)
{
lastName = name;
}
public double GetGPA();
{
return gradePointAverage;
}
public void SetGPA(double gpa);
{
gradePointAverage = gpa;
}
}
//The student named Ross has ID # is 951 and a gpa of 3.5
Reply
Answers (
10
)
C# 2008 error
Casting in C#