I had another example in class today making a program that calculates some stuff about students and classes and what not. the teacher still is not the greatest at explaining loops because i still dont get it but for compare and contrast sakes, using a for and a while loop, how can i do the same task? any ideas?
i need help on the "code here" parts
A user will input the integer number of students in 5 different classes. Validate the number of students is in the range of 1 to 28. Include in the prompt the class number. Calculate the lowest number of students, the highest number of students and average number of students for the 5 classes. Include in the output that class number for each statistical result. The double average number of students must be displayed with two decimals.
Sample Prompt:
Number of students in Class #1:
Sample Output:
Class #1 had the lowest number of students
CODE
using System;
using System.Collections.Generic;
using System.Text;
namespace Lab3ConsoleMTT2
{
class Program
{
static void Main(string[] args)
{
for (int i = 0; i < maxNumClasses; i++)
{
// code here
}
for (int i = 0; i < classArray.length; i++)
{
// code here
}
int currentClass = 0;
while (currentClass < maxNumClasses)
{
// code here
currentClass++;
}
int currentClass = 0;
while (currentClass < classArray.Length)
{
// code here
currentClass++;
}
int currentClass = 0;
do
{
// code here
currentClass++;
} while (currentClass < maxNumClasses);
}
}
}