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
Jlenok [28]
3 years ago
6

Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeopl

e receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who grosses $5,000 in sales in a week receives $200 plus 9% of $5,000, or a total of $650. Write an app (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is an integer). a) $200–299
b) $300–399
c) $400–499
d) $500–599
e) $600–699
f) $700–799
g) $800–899
h) $900–999
i) $1000 and over
Summarize the results in tabular format.
Computers and Technology
1 answer:
inysia [295]3 years ago
6 0

Answer: Provided in the explanation section

Explanation:

import java.util.Scanner;

public class commission

{

   public static void main(String[] args) {

      Scanner input = new Scanner(System.in);

        int totals[]={0,0,0,0,0,0,0,0,0};          

      int n,sales,i,index;

       double salary;

        System.out.print("how many salesmen do you have? ");                          

      n=input.nextInt();

        for(i=1;i<=n;i++)

           {System.out.print("Salesman "+i+" enter sales: ");

            sales=input.nextInt();

            salary=200+(int)(.09*sales);

               System.out.printf("Salary=$%.2f\n",salary);

            index=(int)salary/100-2;

            if(index>8)

                index=8;

            totals[index]++;

            }

        System.out.println("SUMMARY\nSALES\t\tCOUNT");

        for(i=0;i<8;i++)

           System.out.println("$"+(i*100+200)+"-"+(i*100+299)+"\t"+totals[i]);

        System.out.println("$1000 and over\t"+totals[i]);

       }                                

   }

 

cheers i  hope this helped !!      

You might be interested in
write a java program that prompts the user to enter scores (each number an integer from 0 to 10) and prints the following output
Vladimir [108]

Answer:

Explanation:

The following is written in Java. It continues asking the user for inputs until they enter a -1. Then it saves all the values into an array and calculates the number of values entered, the highest, and lowest, and prints all the variables to the screen. The code was tested and the output can be seen in the attached image below.

import java.util.ArrayList;

import java.util.Arrays;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int count = 0;

       int highest, lowest;

       ArrayList<Integer> myArr = new ArrayList<>();

       while (true) {

           System.out.println("Enter a number [0-10] or -1 to exit");

           int num = in.nextInt();

           if (num != -1) {

               if ((num >= 0) && (num <= 10)) {

                   count+= 1;

                   myArr.add(num);

               } else {

                   System.out.println("Wrong Value");

               }

           } else {

               break;

           }

       }

       if (myArr.size() > 3) {

           highest = myArr.get(0);

           lowest = myArr.get(0);

           for (int x: myArr) {

               if (x > highest) {

                   highest = x;

               }

               if (x < lowest) {

                   lowest = x;

               }

           }

           System.out.println("Number of Elements: " + count);

           System.out.println("Highest: " + highest);

           System.out.println("Lowest : " + lowest);

       } else {

           System.out.println("Number of Elements: " + count);

           System.out.println("No Highest or Lowest Elements");

       }

   }

}

4 0
2 years ago
What is the reason of non-deterministic (indeterminate) behavior of concurrent programs?
murzikaleks [220]

Answer: Concurrent programs are the programs that execute at the same point of time. They are simultaneous in nature with other concurrent programs.They are executed with the help of threads  to achieve the concurrency without the issue of scheduling. They are consider long running programs.

The program that has the low execution time compared with all other programs gets executed first.If the case of no progress is seen then another thread is executed.This type of execution gives the non- deterministic situation in which the possibility of leading completion of any particular program cannot be determined.

5 0
2 years ago
Which tool lists active tcp connections?
dimaraw [331]
Netstat
Type netstat -a to get a complete overview.
8 0
3 years ago
Which excel feature prevents you from having to type the same thing over and over?
tamaranim1 [39]

Answer:

Explanation: Another way by which you can do it, press the Ctrl+1 key on your keyboard, Format cells dialog box will get appear. Go to Alignment tab, Click on Justify in Vertical drop down list, click on ok. This is the way by which you can prevent the text from spilling over in Microsoft Excel 2010 and 2013.

6 0
2 years ago
In the ISO/IEC 27002 framework, _________________ describes the use and controls related to encryption.
Nezavi [6.7K]

Answer:

In the ISO/IEC 27002 framework, Cryptography describes the use and controls related to encryption, to help an organization implement, maintain, and improve its information security management.

7 0
3 years ago
Other questions:
  • How to do this? ICT Excel there's a screenshot attached
    6·1 answer
  • 10^4+10-2=<br>10^4+10-2=
    12·2 answers
  • For the questions below, consider a class called ChessPiece. This class has two instance data, String type and int player. The v
    13·1 answer
  • What are some good electronics that I can buy on Amazon?
    14·1 answer
  • The term ____ describes primary storage devices that are implemented as microchips, can read and write with equal speed, and can
    8·1 answer
  • How does netbios identify a computer system on the network?
    13·1 answer
  • Write bash script which takes array as an input of size 10 bind its even indexes to accept even values and odd indexes to accept
    5·1 answer
  • What enables image processing, speech recognition, and complex game play in Artificial Intelligence (AI)?
    7·1 answer
  • Because all the IEEE WLAN features are isolated in the PHY and ____________ layers, practically any LAN application will run on
    11·1 answer
  • We cannot imagine a life without the Internet. Imagine that you had to live without being connected to the Internet. Discuss the
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!