using System;
public class BonusProduction
{
public static void Main()
{
int FName,
LNAME;
double LastYearProduction;
double ThisYearProduction;
Console.WriteLine("Enter your first name");
FName = Convert.ToInt32(Console.ReadLine());
Console.ReadLine("Enter your last name");
LNAME = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Enter Last Year's Production");
LastYearProduction = Convert.ToInt32(Console.ReadLine());
if(LastYearProduction < 0)
Console.WriteLine("Invalid");
{
Console.WriteLine("Enter This Year's Production");
ThisYearProduction = Convert.ToInt32(Console.ReadLine());
if(ThisYearProduction < 0)
Console.WriteLine("Invalid");
}}
public static void CalculateBonus()
{
int FName,
LNAME;
double LastYearProduction;
double ThisYearProduction;
bool bonus;
bonus = ThisYearProduction - LastYearProduction;
if(bonus <= 1000)
Console.WriteLine("Your bonus is $25");
else if(bonus >= 1000 && <= 3000)
Console.WriteLine("Your bonus is $50");
else if(bonus > 3000 && <= 6000)
Console.WriteLine("Your bonus is $100");
else if(bonus > 6000)
Console.WriteLine("your bonus is $200");
{
}
else
Console.WriteLine("Invalid");
}
}
I need this program to ask the user to enter their first and last name, last years production and this years production. based on this input you decide if they get a bonus. if any amount less than zero is entered it should display invalid number. i have to create a method called CalculateBonus. This method will return a double back by calling the method. This method takes two parameters: LastYearProduction and ThisYearProduction(both are double) the method will calculate bonus as follows: 1000 or fewer bonus is 25, 1000 to 3000 bonus is 50, 3001 to 6000 bonus is 100, 6001 and up bonus is 200. Main method should get name, and both productions. check production add in and if less than 0 then it will display invalid and shut down, otherwise it will check to see if ThisYearProduction is greater than LastYearProduction. If it is greater; call the Calculate bonus method and assign the result a suitable variable. Then print the employee name and bonus in a suitable message. Otherwise display no bonus.
I been at this program for 3 days. I cannot get it to work and I've tried many things. I'm new to C by the way. Please help me fix my code, so I can get some rest.