Develop a simple program for an individual savings account. Create two (2) classes named AmountDue (no class modifier) and RunAmountDue (public). 2. For the AmountDue class, create three (3) overloaded methods named computeAmount Due based on the following conditions: • With a single parameter: It represents the price of one (1) item ordered. Add 12% tax and return the total due. • With two (2) parameters. These represent the price of an item and the quantity ordered. Multiply the two (2) values, add 12% tax, and return the total due. With three (3) parameters: These represent the price of an item, the quantity ordered, and the discount amount. Multiply the quantity and price, deduct the discount amount, add 12% tax, and return the total due. 3. For the RunAmount Due class, import the Scanner class to be able to use the nextDouble() method. 4. Instantiate an AmountDue object named due in the main method to use the three (3) overloaded methods you have created earlier. When the program runs, the user can input 1-3 values separated by spaces, then the amount due will be displayed.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter3: Using Methods, Classes, And Objects
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Develop a simple program for an individual savings account. Create two (2) classes named AmountDue (no class modifier) and RunAmountDue (public). 2. For the AmountDue class, create three (3) overloaded methods named computeAmount Due based on the following conditions: • With a single parameter: It represents the price of one (1) item ordered. Add 12% tax and return the total due. • With two (2) parameters. These represent the price of an item and the quantity ordered. Multiply the two (2) values, add 12% tax, and return the total due. With three (3) parameters: These represent the price of an item, the quantity ordered, and the discount amount. Multiply the quantity and price, deduct the discount amount, add 12% tax, and return the total due. 3. For the RunAmount Due class, import the Scanner class to be able to use the nextDouble() method. 4. Instantiate an AmountDue object named due in the main method to use the three (3) overloaded methods you have created earlier. When the program runs, the user can input 1-3 values separated by spaces, then the amount due will be displayed.

STI
IT1908
Task Performance
Amount Due
Objective:
At the end of the activity, the students should be able to:
Apply method overloading in a program.
Procedure:
1. Develop a simple program for an individual savings account. Create two (2) classes named
AmountDue (no class modifier) and RunAmountDue (public).
2. For the AmountDue class, create three (3) overloaded methods named computeAmountDue based
on the following conditions:
With a single parameter: It represents the price of one (1) item ordered. Add 12% tax and
return the total due.
With two (2) parameters: These represent the price of an item and the quantity ordered.
Multiply the two (2) values, add 12% tax, and return the total due.
With three (3) parameters: These represent the price of an item, the quantity ordered, and
the discount amount. Multiply the quantity and price, deduct the discount amount, add 12%
tax, and return the total due.
3. For the RunAmountDue class, import the Scanner class to be able to use the nextDouble()
method.
4. Instantiate an AmountDue object named due in the main method to use the three (3) overloaded
methods you have created earlier. When the program runs, the user can input 1-3 values separated
by spaces, then the amount due will be displayed.
Sample Output:
Press any of the following then enter values separated by spaces:
1 - Price only
2 - Price and quantity
3 - Price, quantity, and discount amount
3
300 4 50
Amount due is 1186.0
GRADING RUBRIC (100 points):
Criterion
Description
Max Points
The code produces the expected result.
The code meets the specifications of the problem.
The code is concise without sacrificing correctness and logic.
The code adheres to the rules of the programming language.
Correctness
40
Logic
Efficiency
Syntax
40
10
10
*Property of STI
Page 1 of 1
03 Task Performance 1
Transcribed Image Text:STI IT1908 Task Performance Amount Due Objective: At the end of the activity, the students should be able to: Apply method overloading in a program. Procedure: 1. Develop a simple program for an individual savings account. Create two (2) classes named AmountDue (no class modifier) and RunAmountDue (public). 2. For the AmountDue class, create three (3) overloaded methods named computeAmountDue based on the following conditions: With a single parameter: It represents the price of one (1) item ordered. Add 12% tax and return the total due. With two (2) parameters: These represent the price of an item and the quantity ordered. Multiply the two (2) values, add 12% tax, and return the total due. With three (3) parameters: These represent the price of an item, the quantity ordered, and the discount amount. Multiply the quantity and price, deduct the discount amount, add 12% tax, and return the total due. 3. For the RunAmountDue class, import the Scanner class to be able to use the nextDouble() method. 4. Instantiate an AmountDue object named due in the main method to use the three (3) overloaded methods you have created earlier. When the program runs, the user can input 1-3 values separated by spaces, then the amount due will be displayed. Sample Output: Press any of the following then enter values separated by spaces: 1 - Price only 2 - Price and quantity 3 - Price, quantity, and discount amount 3 300 4 50 Amount due is 1186.0 GRADING RUBRIC (100 points): Criterion Description Max Points The code produces the expected result. The code meets the specifications of the problem. The code is concise without sacrificing correctness and logic. The code adheres to the rules of the programming language. Correctness 40 Logic Efficiency Syntax 40 10 10 *Property of STI Page 1 of 1 03 Task Performance 1
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Developing computer interface
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
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,