Q005 Sales Commission_program in java
Q005 Sales Commission_program in java
Q005 Sales Commission_program in java
Main.java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter Details");
System.out.print("Sales Executive id: ");
int id = scanner.nextInt();
scanner.nextLine();
System.out.print("Name: ");
String name = scanner.nextLine();
System.out.print("Monthly sales amount: ");
double monthlySales = scanner.nextDouble();
scanner.close();
}
}
SalesExecutive.java
public class SalesExecutive {
private int id;
private String name;
private double monthlySales;
private static final double FIXED_SALARY = 10000.00;
Output:
Test Case 1:
Enter Details
Sales Executive id: 2001
Name: Ravi
Monthly sales amount: 80000.00
Sales Executive Salary details
Sales Executive id: 2001
Name: Ravi
Monthly sales amount: 80000.00
Commission offered:1.0%
Fixed salary Sales Executive: 10000.00
Sales Executive Commission amount: 800.00
Net Amount Paid to Sales Executive: 10800.00
Test Case 2:
Enter Details
Sales Executive id: 2003
Name: Tom
Monthly sales amount: 30000
Sales Executive Salary details
Sales Executive id: 2003
Name: Tom
Monthly sales amount: 30000.00
Commission offered: Please provide justification for low sales
Fixed salary: 10000.00
Commission amount: 0.00
Net salary: 10000.00