-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCourse.cs
More file actions
23 lines (22 loc) · 825 Bytes
/
Course.cs
File metadata and controls
23 lines (22 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
namespace TinyCollegeGUI
{
public class Course
{
public string CourseID { get; set; }
public string CourseName { get; set; }
public int Credits { get; set; }
public Course() { }
// gives values to the info that corresponds to the courses in the database, like the course ID, the name of the course, and how many credits the course is worth
public Course(string courseId, string courseName, int credits)
{
CourseID = courseId;
CourseName = courseName;
Credits = credits;
}
// override the ToString method in order to provide information about the type to client code
public override string ToString()
{
return $"{CourseName} ({CourseID}) - {Credits} Credits";
}
}
}