Create a class named Commission that includes three variables: a double sales figure, a double commission rate, and an int commission rate. Create two overloaded methods named computeCommission(). The first method takes two double parameters representing sales and rate, multiplies them, and then displays the results. The second method takes two parameters: a double sales figure and an integer commission rate. This method must divide the commission rate figure by 100.0 before multiplying by the sales figure and displaying the commission. Supply appropriate values for the variables, and write a main() method Save the file that tests each overloaded method. as Commission.java.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Create a class named Commission that includes three variables:
a double sales figure, a double commission rate, and an int
commission rate. Create two overloaded methods named
computeCommission(). The first method takes two double
parameters representing sales and rate, multiplies them, and then
displays the results. The second method takes two parameters: a
double sales figure and an integer commission rate. This method
must divide the commission rate figure by 100.0 before multiplying
by the sales figure and displaying the commission. Supply
appropriate values for the variables, and write a main() method
method. Save the file
that tests each overloaded
as
Commission.java.
Transcribed Image Text:Create a class named Commission that includes three variables: a double sales figure, a double commission rate, and an int commission rate. Create two overloaded methods named computeCommission(). The first method takes two double parameters representing sales and rate, multiplies them, and then displays the results. The second method takes two parameters: a double sales figure and an integer commission rate. This method must divide the commission rate figure by 100.0 before multiplying by the sales figure and displaying the commission. Supply appropriate values for the variables, and write a main() method method. Save the file that tests each overloaded as Commission.java.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,