I wrote the program up, but I'm getting all types of errors. Which I'm new to this whole Java Application class. I keep getting errors :
Please help.
- employee is not defined.
- NewSalesPerson is not defined.
- UtilnumFormat is not defined.
- Variable declaration not allowed here.
- error: ';' expected.
-
reached end of the file while parsing.
import java.text.DecimalFormat; //used to format currency
import java.util.Scanner; //used for the scanner/*Write a Javaâ„¢ application using jGRASPâ„¢ Integrated
Development Environment (IDE) that calculates the total annual
compensation of a salesperson. Consider the following factors:
A salesperson will earn a fixed salary of $35,000.
A salesperson will also receive a commission as a sales
incentive. Commission is a percentage of the salesperson’s- annual sales. The current commission is 15% of total sales.
The total annual compensation is the fixed salary plus the
commission earned.
The Javaâ„¢ application should meet these technical requirements:
The application should have at least one class, in addition to the
application’s controlling class (a controlling class is where the
main function resides).
There should be proper documentation in the source code.
The application should ask the user to enter annual sales, and it
should display the total annual compensation.*/
/*
-
@author Monique
*/
public class Compensation{private static SalesPerson employee;
// SALESPERSON Object
Scanner user_input=newScanner(System.in); // input as a Scanner object (used for keyboard monitoring)
public static void main(String[] args);{double annualSalary;
System.out.println("Salesperson Annual Compensation Calculator");
System.out.print1n("Please enter the employee's annual sales:");
annualSalary=myScanner.nextDouble();employee = newSalesPerson(user_Input);
System.out.println("Salesperson information:");
System.out.println("Fixed Salary: $" + UtilsnumFormat(employee.fixedSalary);
System.out.println("Annual Sales: $" + UtilsnumFormat(employee.annualSales);
System.out.println("Current Commission: $" + UtilsnumFormat(employee.curCommission);
System.out.println("Current Commission Rate: " +(employee.curCommissionRate*100+ "%");
System.out.println("Total Annual Compensation: $" + UtilsnumFormat(employee.totalCompensation);
System.out.println("Enter Y to reset. Anything else to quit.");
if (input.next(),toLowerCase(),equals("y")) {
main(args);
}
}
- annual sales. The current commission is 15% of total sales.
I keep getting errors :
- employee is not defined.
- NewSalesPerson is not defined.
- UtilnumFormat is not defined.
- Variable declaration not allowed here.
- error: ';' expected.
- reached end of the file while parsing.