Giter Club home page Giter Club logo

paymentmode's Introduction

PaymentMode - Object Oriented Programming

A simple java program that demonstrates the concept of inheritance with the use of interface Payment Mode to create classes that are of specific modes of Payment: GCash, Maya, ShopeePay.

Note: This project is a seatwork for my OOP subject. I was instructed to make a simple program out of a given uml class diagram. I added two contructors: one for when user specifies a Payment Method, two for when user doesn't specify a Payment Method. See instructions at the bottom.



This Contains

๐Ÿ“ ./src/

  • PaymentApp.java : Contains the main method of the project. Instantiates an example of an Order object.
  • Order.java : Has two constructors (one including PaymentMethod, two not including PaymentMethod)
  • PaymentMode.java : An interface for specific payment methods.
  • GCash.java : implements PaymentMode
  • Maya.java : implements PaymentMode
  • ShopeePay.java : implements PaymentMode

Screenshots

๐Ÿ’พ Main Method

: PaymentApp.java, instanciated two order orbjects: order1 which specifies PaymentMethod, and order2 which doesn't.

main

๐Ÿ’พ Output 1 (Payment Method is specified)

: Print detail output for creation of order1

output1

๐Ÿ’พ Output 2 (Payment Method is not specified)

: Print detail output for creation of order2

output2

SW 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.
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).
The application should implement a PaymentMode interface that defines a method for calculating the discount offered by the payment method.
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

The application should allow users to set the payment method for an order and calculate the total amount, storing it in the totalAmount attribute.

paymentmode's People

Contributors

jhoendev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.