-1

I'm just trying to make a basic program and here is part of my instructions:

  1. Create a class "Course".
    • create a constructor with two string parameters "courseId" and "courseName".
    • create two string data members "CID" with property "ID"(set, get), and "CName" with property "Name"(set, get).

For one, I don't understand how to have a string property "ID", when the data member already has a name, and the property is get and set.

Also, my code gives me an error code CS8180 ( { or ; or => expected ). When I click on the error, it leads me to the space after my set. Take a look:

using System;

class Course
{
    public string CID { get; set }

    public void CourseInfo(string courseId, string courseName)
    {
    }


}
gmiley
  • 6,531
  • 1
  • 13
  • 25
Pollutxdd
  • 19
  • 3

1 Answers1

3

You are missing a ; after set :

using System;

class Course 
{ 
   public string CID { get; set; }

   public void CourseInfo(string courseId, string courseName)
   {
   }
}
lema
  • 470
  • 2
  • 9