1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
N76 [4]
3 years ago
5

. Create a java File call Sales.Java contains a Java program that prompts for reads in the sales for each of 5 salespeople in a

company. It then prints out the id and amount of sales for each salesperson and the total sale. 2. Compute and print the average sale. 3. Find and print the maximum and minimum sale. 4. After the list, sum, average, max and min have been printed, ask the user to enter a value. Then print the id of each salesperson who exceeded that amount, and the amount of their sales. Also print the total number of salespeople whose sales exceeded the value entered. 5. Instead of always reading in 5 sales amounts, in the beginning ask the user for the number of sales people and then create an array that is just the right size. The program can then proceed as before
Computers and Technology
1 answer:
Slav-nsk [51]3 years ago
6 0

Answer:

The program is as follows:

import java.util.*;

public class Sales{

public static void main(String[] args) {

 Scanner input = new Scanner(System.in);

 int salesPeople;

 System.out.print("Number of Sales People: ");

 salesPeople = input.nextInt();

 int[] salesID = new int[salesPeople];

 float[] salesAmount = new float[salesPeople];

 float total = 0;

 for(int i = 0; i<salesPeople;i++){

     System.out.print("ID: ");      salesID[i] = input.nextInt();

     System.out.print("Amount: ");      salesAmount[i] = input.nextFloat();

     total+=salesAmount[i];  }

 System.out.println("ID\t\tAmount");

 for(int i = 0; i<salesPeople;i++){

     System.out.println(salesID[i]+"\t\t"+salesAmount[i]);  }

 System.out.println("Total Sales: "+total);

 System.out.println("Average Sales: "+total/salesPeople);

 Arrays.sort(salesAmount);

 System.out.println("Minimum Sales: "+salesAmount[0]);

 System.out.println("Maximum Sales: "+salesAmount[salesPeople-1]);

 float sales;

 System.out.print("Print records that exceed: ");      sales = input.nextFloat();

 System.out.println("\nID\t\tAmount");

 int count = 0;

 for(int i = 0; i<salesPeople;i++){

     if(salesAmount[i]>sales){

         System.out.println(salesID[i]+"\t\t"+salesAmount[i]);

         count++;      }  }

 System.out.print("Total sales records that exceed "+sales+" are: "+count);

}

}

Explanation:

See attachment for program source file where comments are used as explanation

Download txt
You might be interested in
"The _____ of the Open Systems Interconnection (OSI) model generates the receiver’s address and ensures the integrity of message
aleksklad [387]

Answer:

The transport layer

Explanation: Layer 4, is the transport layer of the Open System Interconnection (OSI), that handles message transfer of data between end systems or hosts and ensures complete packets transfer.

7 0
3 years ago
Read 2 more answers
Successful attacks are commonly called ________. a. security incidents b. countermeasures c. both a and b d. neither a nor b
nadya68 [22]
Hey there,
The answer is Security Incidents

Hope this helps :))

~Top
4 0
3 years ago
Why do you think you are ready to handle the high school type of education and atmosphere? (in complete sentences)​
sertanlavr [38]

Answer:

I'm already in high school but at first, I was scared for my life literally. It wasn't what I expected it to be, though. Everyone was super nice to me and has been ever since I started. Turns out, high school is amazing.

Explanation:

5 0
3 years ago
time to throw poggers xqc time to throw pogchamp time to throw pogchamp time to throw pogchamp time to throw pogchamp time to th
Effectus [21]
Yes thank you very much
6 0
3 years ago
Read 2 more answers
Multiple client switches and routers have been set up at a small military base. The network team decided to implement Terminal A
Vikentia [17]

Answer:

a. device administration

Explanation:

Device Administration is a powerful API feature on the Android framework which was first introduced in Android version 2.2. It offers some features at the system level that enables some other key features such as the storage on a device, remotely wiping or enforcing password policies.

It is also utilized in uninstalling your application from the device or to capture a picture by the use of camera when screen is lock.

7 0
3 years ago
Other questions:
  • What is a drawback to being in Slide Show mode? a- Being able to review each slide in order
    8·2 answers
  • he function below takes one parameter: a list of strings (string_list). Complete the function to return a new list containing on
    5·2 answers
  • The type of business organization that can continue indefinitely is known as a
    11·1 answer
  • Before entering a road from an alley or driveway, you must:Flash your high beam headlights 
    13·1 answer
  • How do I select cells A3 through F3 in Excel 2013
    14·1 answer
  • What is an AUP?<br> help?????
    11·2 answers
  • Name the written test a potential driver must pass and list the minimum required score to earn a learner’s license.
    8·2 answers
  • Which one way in which using infrared in game console controllers could affect the experience of a person playing the game?
    8·1 answer
  • What would be the results if the Formula =2*C8+3*D9 is entered into a cell if the value displayed in C8 is 3,and the value in ce
    10·1 answer
  • Can someone write an essay on data storage and describe the different storages I have listed below•
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!