Please code in C# Create a console application that prompts the user for a numbe
ID: 3575547 • Letter: P
Question
Please code in C#
Create a console application that prompts the user for a number of students, and the dollar amount of the old budget. Depending on the number of students determine the new budget with the correct amount of increase. Assume there may be more than 5 inputs. Use a sentinel value to terminate the program. The program must run all test cases in one execution Number of Students Budget Increase 300 1% 300 400 2% 401 500 3% 501 600 4% 601 or more 5% Run application with the following data and save the screenshot of inputs and outputs to submit Input Enter Number of Students 999 to terminate): 200 Enter Old Budget: 100 Enter Number of Students 999 to terminate): 450 Enter Old Budget: 2000 Enter Number of Students (-999 to terminate): -300 Invalid number entered! Please enter a valid value: 600 Enter Old Budget: 500.00Explanation / Answer
using System;
using System.Collections;
class MainClass {
public static void Main (string[] args) {
int[] students = new int[100];
double[] oldbudjet = new double[100];
int j=0;
while(true){
int s=-1;
double b;
while(s<0 && s != -999){
Console.Write("Enter Number of Students, (-999 to terminate):");
int.TryParse(Console.ReadLine(), out s);
}
if(s==-999){
break;
}
Console.Write("Enter the Old Budjet:");
double.TryParse(Console.ReadLine(), out b);
students[j] = s;
oldbudjet[j] = b;
j++;
}
Console.WriteLine("Number of Students: Old Budget: Budget Increase New Budget");
for (int i = 0; i < j; i++)
{
int p=0;
if(students[i]<300)
p = 1;
else if(students[i]>300 && students[i]<400)
p = 2;
else if(students[i]>401 && students[i]<500)
p = 3;
else if(students[i]>501 && students[i]<600)
p = 4;
else if(students[i]>600)
p = 5;
Console.WriteLine(" "+students[i]+" "+oldbudjet[i]+" "+p+"% "+(oldbudjet[i]*(p/100.0) + oldbudjet[i]));
}
}
}