Sales Report

i'm having some trouble with this question when i'm running the program, it asks me for the 1st salesman name and his total sales (great) but it doesnt prompt me properly for the info from the 2nd ,3rd and so on.



here is the question
Write a program to accept as input the value of sales reported by 6 salespersons. Any salesperson reporting sales in excess of 20,000 should receive a commission of 10% of his/her sales. Your program should print the name of the salesperson and calculate and print the total sales along with the total amount of commission paid.

here is my code

package javaapplication1;
import java.util.Scanner;

public class Sales_Report {
public static void main (String []args){

Scanner input = new Scanner(System.in);

String first_name;
String second_name;
//third_name,fourth_name,fifth_name,sixth_name;
double total_sales,total_commission_paid;

{System.out.println("Please enter 1st salesperson full name");
first_name = input.nextLine();
System.out.println("Please enter 1st salesperson total sales");
total_sales = input.nextDouble();}


{System.out.println("Please enter 2nd salesperson full name");
second_name = input.nextLine();
System.out.println("Please enter 2nd salesperson total sales");
total_sales = input.nextDouble();}


{System.out.println("Please enter 3rd salesperson full name");
third_name = input.nextLine();
System.out.println("Please enter 3rd salesperson total sales");
total_sales = input.nextDouble();}


{System.out.println("Please enter 4th salesperson full name");
fourth_name = input.nextLine();
System.out.println("Please enter 4th salesperson total sales");
total_sales = input.nextDouble();}


{System.out.println("Please enter 5th salesperson full name");
fifth_name = input.nextLine();
System.out.println("Please enter 5th salesperson total sales");
total_sales = input.nextDouble();}


{System.out.println("Please enter 6th salesperson full name");
sixth_name = input.nextLine();
System.out.println("Please enter 6th salesperson total sales");
total_sales = input.nextDouble();}

if (total_sales > 20.000);
{System.out.println("Salesperson is to recieve a 10% comission on their total sales");
total_commission_paid = total_sales * 0.01;}

System.out.println("The total commission paid to the employee is " + total_commission_paid);


}
}



do i have any errors that are causing me to get this problem?
PharaohD wrote:
do i have any errors that are causing me to get this problem?


You have mistaken the word "java" for the word "c++".
Topic archived. No new replies allowed.