Question: C# SAMPLE CODE: /* This program uses three parallel * arrays to display the class name * and how many places are left in that

C#

C# SAMPLE CODE: /* This program uses three parallel * arrays to

SAMPLE CODE:

/* This program uses three parallel * arrays to display the class name * and how many places are left in that * class. */ using System; namespace ClassEnrolment { class ClassEnrolment { public static void Main() { string[] className = new string[] { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" }; int[] currentEnrolment = new int[] { 25, 18, 32, 31, 28 }; int[] maximumEnrolment = new int[] { 29, 23, 32, 36, 31 }; Console.WriteLine("Number of places still available for each class. "); // Write a "for" loop here, using the className.Length property. // Do not change any of the existing lines of code. // ... // ... // ... ExitProgram(); } public static void ExitProgram() { Console.Write("Press enter to continue ..."); Console.ReadLine(); } } }

For this task you are given a partially-complete program a program designed to show the number of enrolment positions open for each class, or display that the class is full if that is the case The completed program should first display the text "Number of places still available for each class." followed by a blank line. Following this blank line, it should display one line of text for each class. That line should be of the following format "(class name has (number of places left) places left." class namehas number of places le The number of places left in each class is the maximum enrolment minus the current enrolment. If there are no places left (the current enrolment is the same as the maximum enrolment) this line should instead be displayed: (class name) is full

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!