Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payment Application

Instructions

Develop a payment application that allows users to place orders for items, define the quantity, unit price, and choose a payment method (GCash, Maya, ShopeePay). The application should calculate the total amount based on the order details and any applicable discounts offered by the chosen payment method, storing the result in the totalAmount attribute of the Order class.

Specific Requirements

PaymentApp class

This class serves as the entry point for the application. It demonstrates how to create an Order object, set its properties (item, quantity, unit price, and payment method), and calculate the total amount based on the chosen payment method.

Order class

The application should have an Order class that stores information about the ordered item, quantity, unit price, chosen payment method, and the calculated total amount (totalAmount).

PaymentMode interface

The application should implement a PaymentMode interface that defines a method for calculating the discount offered by the payment method.

Concrete implementations of PaymentMode

The application should have concrete implementations of PaymentMode for GCash, Maya, ShopeePay:

  • GCash: Does not offer any discount (discount rate = 0.0)
  • Maya: Offers a 5% discount (discount rate = 0.05)
  • ShopeePay: Offers a 10% discount (discount rate = 0.10)

Class Diagram

diagram

Sample Output

Order item is keyboard.
Unit price is 300.0
Quantity is 10

Payment order details if GCash
Discount rate is 0.0
Payment amount is 3000.0

Payment order details if Maya
Discount rate is 0.05
Payment amount is 2850.0

Payment order details if ShopeePay
Discount rate is 0.10
Payment amount is 2700.0

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages