
// ******************** // Sales.java // // Reads in and stores sales for each of 5 salespeople. Displays // sales entered by salesperson id and total sales for all salespeople. // // ********************
import java.util.Scanner;
public class Sales
{
public static void main(String[] args)
{
final int SALESPEOPLE = 5;
int[] sales = new int[SALESPEOPLE];
int sum;
int salesPerson=-1;
int salesPerson1 = -1;
int number;
int x;
Scanner scan = new Scanner(System.in);
for (int i=0; i { System.out.print("Enter sales for salesperson " + (i+1) + ": "); sales[i] = scan.nextInt(); } System.out.println("\nSalesperson Sales"); System.out.println("--------------------"); sum = 0; for (int i=0; i { System.out.println(" " + (i+1) + " " + sales[i]); sum += sales[i]; } System.out.println("\nTotal sales: " + "$" + sum); int average= sum/5; System.out.println("Average Sale:" + " " + "$" + average); System.out.println(); int max = sales[0]; for (int i=0; i < sales.length; i++) System.out.println("Salesperson " + (salesPerson + 1) + " had the highest sale with :" + max); int min = 100000; for (int i=0; i < sales.length; i++) {if (sales[i] } } System.out.println("Salesperson " + (salesPerson1 + 1) + " had the lowest sale with :" +
min); { System.out.print("Enter a number: " ); number[x] = scan.nextInt(); for (int x=0; x < number; x++) {if (number[x] < ) } } } OK, So heres my problem, someone is supposed to enter a number towards the end of this code and the output should show the "salesperson" id tags that fell below that number. The number of the input should represent the "sales" of the "salesperson." I realize that the bottom part of the code: System.out.print("Enter a number: " ); number[x] = scan.nextInt(); for (int x=0; x < number; x++) {if (number[x] < ) is wrong but I need help from this part on. I need that part corrected and add a portion that would ask the user to input a number, return the "salesperson" id tag's that exceed that number along with their "sales" and also the total number of "salesperson"'s that exceeded that number. Any help I would greatly appreciate. Thank you{if (sales[i]>max){
max = sales[i];
salesPerson = i;}
}
min = sales[i];
salesPerson1 = i;
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.