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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education