Basically I have to do this: Write a program that displays the number of students that can still enroll in a given class.
Design your solution using parallel arrays.
my problem is what loops should I use for this I dont think for loops would be useful at all...I think foreach
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
string[] classes = new string[] { "CS150", "CS250", "CS270", "CS300", "CS350" };
byte[] currentEnrolled = new byte[] { 18, 11, 9, 4, 20 };
byte[] maxEnrollment = new byte[] { 20, 20, 20, 20, 20 };
currentEnrolled = checkClassSize();
string className;
string userVal;
bool data = true;
DisplayInstructions();
userVal = GetUserVal();
} // end of main
public static void DisplayInstructions()
{
Console.WriteLine("This program will check the number of opening seats for a class you type in");
Console.WriteLine("");
Console.Clear();
Console.WriteLine("Please press any key to continue....");
Console.ReadKey();
} // end of display instructions
public static string GetUserVal()
{
string userVal;
Console.WriteLine("Please enter a class you wish to check an open seat for");
userVal = Console.ReadLine();
return userVal;
}
public static string checkClassSize()
{
byte currentEnrolled;
for (i = 0; i < Array.currentEnrolled; i++ )
{
Console.WriteLine(i);
}
}
}// end of class
} // end of namespace
Thanks