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
lianna [129]
3 years ago
9

Write a program with a method computeCommission which takes a double that is the salesAmount and returns the commissions for sal

es from $10,000 to $100,000 in increments of $5,000. Commissions are calculated by one of two formulas depending on the amount:a. A sale up to $50,000, 8 percent for the first $5,000 and 10 percent of the remainderb. A sale over $50,000, 9 percent for the first $5,000 and 12 percent of the remainderE

Computers and Technology
1 answer:
miv72 [106K]3 years ago
4 0

Answer:

Explanation:

def computeCommission(salesAmount):

   commission=0

   if salesAmount <= 50000:

       commission = 5000*0.08 + (salesAmount-5000)*0.1

   elif salesAmount > 50000:

       commission = 5000*0.09 + (salesAmount-5000)*0.12

   return commission

print("commission for 45000 : "+str(computeCommission(45000)))

print("commission for 54000 : "+str(computeCommission(54000)))

You might be interested in
When a Select Case statement executes, the value of the test expression is compared with the values that follow each of the ____
goldenfox [79]

Answer:

Case

Explanation:

In Computer programming, a variable can be defined as a placeholder or container for holding a piece of information that can be modified or edited.

Basically, variable stores information which is passed from the location of the method call directly to the method that is called by the program.

For example, they can serve as a model for a function; when used as an input, such as for passing a value to a function and when used as an output, such as for retrieving a value from the same function. Therefore, when you create variables in a function, you can can set the values for their parameters.

A Select Case statement can be defined as a conditional statement that avails software developers or programmers the ability to test a variable by comparing it with a list of values.

In a Select Case statement, each variable is referred to as a Case.

Generally, when a Select Case statement executes, the value of the test expression is compared with the values that follow each of the Case keywords.

7 0
3 years ago
Vivek wants to save the data about his grocery store in a single table. Which among the following type of databases is used in t
Orlov [11]

Explanation:

A centralized database (sometimes abbreviated CDB) is a database that is located, stored, and maintained in a single location.

4 0
3 years ago
A mobile device is freezing almost daily. The device remains powered on and the screen illuminated. The user restarts the device
Brums [2.3K]

Answer:

Factory reset the data

Explanation:

This option restores the phone to default thereby eliminating possible files that might have been responsible for the way the phone has been responding for days.

3 0
3 years ago
For this problem, you will write a function standard_deviation that takes a list whose elements are numbers (they may be floats
Evgesh-ka [11]

Answer:

  1. import math  
  2. def standard_deviation(aList):
  3.    sum = 0
  4.    for x in aList:
  5.        sum += x  
  6.    
  7.    mean = sum / float(len(aList))
  8.    sumDe = 0
  9.    for x in aList:
  10.        sumDe += (x - mean) * (x - mean)
  11.    
  12.    variance = sumDe / float(len(aList))
  13.    SD = math.sqrt(variance)
  14.    return SD  
  15. print(standard_deviation([3,6, 7, 9, 12, 17]))

Explanation:

The solution code is written in Python 3.

Firstly, we need to import math module (Line 1).

Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).

We can test the function using a sample list (Line 20) and we shall get 4.509249752822894

If we pass an empty list, a ZeroDivisionError exception will be raised.

3 0
3 years ago
How would Patrick save his formatted message in Outlook?
zalisa [80]

Answer:

O Click Save and it remains in the Draft folder for later edits.

Explanation:

I hope it's help

6 0
3 years ago
Other questions:
  • Write a program that calls fork(). Before calling fork(), have the main process access a variable (e.g., x) and set its value to
    5·1 answer
  • CAD helps professionals to _____. create a technical drawing give directions to a new location calculate the interest rate of a
    13·2 answers
  • What is meant by polling mode in communication between software andUART and what is its disadvantage as compared to interrupt mo
    14·1 answer
  • To achieve balance—that is, to operate an information system that satisfies the user and the security professional—the security
    13·1 answer
  • Marla wants to transfer photos from her digital camera to her computer. She has plugged the camera's cord into the USB port. Wha
    11·2 answers
  • State the functions of all the parts of the computer​
    14·1 answer
  • 9.4 Code Practice: Your task is to determine whether each item in the array above is divisible
    14·1 answer
  • Essay about evolution of media shaped the values and norms of the society
    11·1 answer
  • Several disaster relief nonprofits want to create a centralized application and repository of information so that they can effic
    7·1 answer
  • How will the health care professions be affected by all the computerized and technical advances concerning disabilities?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!