0% found this document useful (0 votes)
1K views1 page

03 Task Performance 1

This document provides instructions for a programming task to apply method overloading. Students are asked to create two classes - AmountDue and RunAmountDue. The AmountDue class will contain three overloaded computeAmountDue methods that calculate the total amount due based on 1, 2, or 3 input parameters for item price, quantity, and discount. The RunAmountDue class will use the Scanner class to accept user input and display the output from calling the overloaded methods. The output should show the total amount due based on the number of inputs separated by spaces. Students will be graded on correctness, logic, efficiency, and syntax based on a 100 point rubric.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views1 page

03 Task Performance 1

This document provides instructions for a programming task to apply method overloading. Students are asked to create two classes - AmountDue and RunAmountDue. The AmountDue class will contain three overloaded computeAmountDue methods that calculate the total amount due based on 1, 2, or 3 input parameters for item price, quantity, and discount. The RunAmountDue class will use the Scanner class to accept user input and display the output from calling the overloaded methods. The output should show the total amount due based on the number of inputs separated by spaces. Students will be graded on correctness, logic, efficiency, and syntax based on a 100 point rubric.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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:

GRADING RUBRIC (100 points):


Criterion Description Max Points
Correctness The code produces the expected result. 40
Logic The code meets the specifications of the problem. 40
Efficiency The code is concise without sacrificing correctness and logic. 10
Syntax The code adheres to the rules of the programming language. 10

03 Task Performance 1 *Property of STI


Page 1 of 1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy