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 class VISACard with the following method.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 20PE: When you borrow money to buy a house, a car, or for some other purpose, you repay the loan by making...
icon
Related questions
Question

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 class VISACard with 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 class HPVISACard which extends VISACard 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.

Consider the Main class 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

Expert Solution
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT