Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2 1 : 3 8 . III BIRZEIT UNIVERSITY Faculty of Engineering and Information Technology Computer Science Department Comp 2 3 1 0 Project Individual

21:38
. III
BIRZEIT UNIVERSITY
Faculty of Engineering and Information Technology
Computer Science Department Comp 2310 Project
Individual work project. Due Date: Sat. 27/1/2024 by 10:00 pm on ITC
Given the following UML diagram:
Please do the following:
1- Create class/interface that implements the classes + interface displayed in the UML displayed above exactly as specified (same variable names, types, ...). Make sure to include no-arg + all field constructors, setters + getters, as well as toString() methods in each of the classes created. Please note the following:
a- method calculatePayment()is implemented differently in each of the concrete classes as follows:
in class Cash it is calculated as the payment amount entered minus the discountRate percentage (e.g. if amount is 200.0 and discountRate is 11.0 then payment value is 178.0)
in class Check, payment is the same as the amount entered.
in class CreditCard, payment is the amount plus the chargingFee.
b- method printPaymentInfo) prints the properties and the calculated payment by calling both the toString() as well as the calculatePayment() methods.
c- class CustomerPayment is Comparable based on the value returned by the method calculatePayment().
d- Check class has a variable called type (int) which is set using one of three constant values that should be defined in the class CASHIFR =1 CFRTIFIFD =?
itc.
birzeit.edu
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago