using System;
public class GreenvilleRevenueGUI
{
public static void Main()
{
//number of contestants
int PC;
int CC;
int DPC; //doubled PC
int L = 0;
Console.WriteLine("Each contestant must pay $25."); //displayed text and instructions
while (L < 1)
{
Console.WriteLine("How many contestants entered last year?");
PC = Convert.ToInt32(Console.ReadLine()); //input number of contestants here
//PC = 31;
if (PC < 0 || PC > 30)
{
Console.WriteLine("Invalid amount of contestants.");
}
else
{
L++;
}
}
while (L < 2)
{
Console.WriteLine("How many contestants entered this year?");
CC = Convert.ToInt32(Console.ReadLine()); //input number of contestants here
if (CC < 0 || CC > 30)
{
Console.WriteLine("Invalid amount of contestants.");
}
else
{
L++;
}
}
PC = 15;
CC = 12;
//getting totals
Console.WriteLine("Amount made last year:");
Console.Write(PC + " X 25 = $"); //Using "write" instead of "writeline" so it doesn't go to the next line.
PC = PC * 25; //figures out the total
Console.WriteLine(PC); //displays total
Console.WriteLine("Amount made this year:");
Console.Write(CC + " X 25 = $"); //Using "write" instead of "writeline" so it doesn't go to the next line.
CC = CC * 25; //figures out the total
Console.WriteLine(CC); //displays total
DPC = PC * 2; //just to make it easier to check for double
if (CC > PC)
{
if (CC > DPC) //the double check is place here since CC has to be bigger than PC, so putting it here not only makes the code check for less things at once, but it won't display the text for two different conditions if CC is bigger than DPC
{
Console.WriteLine("The competition is more than twice as big this year!");
}
else
{
Console.WriteLine("The competition is bigger than ever!");
}
}
else if (CC < PC) //would normally make it just an else, but since it's check for lower and there's no condition for equal
{
Console.WriteLine("A tighter race this year! Come out and cast your vote!");
}
}
}