Calculate Reward Points ABC Bank announced a new scheme of reward points for a transaction using an ATM card. Each transaction using the normal card will be provided 1% of the transaction amount as a...

1 answer below »



Calculate Reward Points





ABC Bank announced a new scheme of reward points for a transaction using an ATM card. Each transaction using the normal card will be provided 1% of the transaction amount as a reward point. If a transaction is made using a premium card and it is for fuel expenses, additional 10 points will be rewarded. Write a java program to calculate the total reward points.



[Note:  Strictly adhere to the object-oriented specifications given as a part of the problem statement.
Follow the naming conventions as mentioned]




Consider a classVISACardwith the following method.













Method

Description
public Double computeRewardPoints(String type, Double amount)This method returns the 1% of the transaction amount as reward points




Consider a classHPVISACardwhich extendsVISACard class and overrides the following method.













Method

Description
public Double computeRewardPoints(String type, Double amount)In this method, calculate the reward points from the base class and add 10 points if it is for fuel expense



Hint:



Use super keyword to calculate reward points from base class.


Considerthe Mainclass with the main method and read all the transaction details in the main method.
Card type will be either‘VISA card’ or ‘HPVISA card’. Otherwise, display‘Invalid data’



Calculate the reward points corresponding to the card type and transaction type and print the reward points(upto two decimal places).


The link to download the template code is given below
Code Template



Input and Output Format
:



Refer sample input and output for formatting specifications.
Enter the transaction details in CSV format ( Transaction type, amount, card type)



All text in bold corresponds to the input and the rest corresponds to output.




Sample Input and Output 1:



Enter the transaction detail

Shopping,5000
,VISA
 card

Total reward points earned in this transaction is 50.00
Do you want to continue?(Yes/No)

Yes

Enter the transaction detail

Fuel,5000,
HIVISA
 card

Invalid data
Do you want to continue?(Yes/No)

Yes

Enter the transaction detail

Fuel,5000,HPVISA card

Total reward points earned in this transaction is 60.00
Do you want to continue?(Yes/No)

No




Sample Input and Output 2:



Enter the transaction detail

Fuel,1000
,
HPVISA card

Total reward points earned in this transaction is 20.00
Do you want to continue?(Yes/No)

No



Answered 105 days AfterJun 07, 2022

Answer To: Calculate Reward Points ABC Bank announced a new scheme of reward points for a transaction using an...

Kshitij answered on Sep 21 2022
69 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here