Question: C# Write a two class solution that includes data members for the name of the course, current enrollment, and maximum enrollment. Include an instance method
C#
Write a two class solution that includes data members for the name of the course, current enrollment, and maximum enrollment. Include an instance method that returns the number of students that can still enroll in the course. The ToString( ) method should return the name of the course, current enrollment, and the number of open slots. Declare an array of class objects in your implementation class. Test your application with the following data:
Class name Current enrollment Maximum enrollment
cs150 180 200
cs250 21 30
cs270 9 20
cs300 4 20
cs350 20 20
it has to be a console aplication
Your program should gather information in the driver class for each specific course, including all of the data members mentioned, then create an object for the course as an element of an object array. You may ask the user how many courses they will be entering.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace ConsoleApplication1 { class Program { static void Main(string[] args) { } } }
sing System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks;
namespace ConsoleApplication1 { class Class1 { public Class1() { } public int Property { get { } set { } } } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
