You are on page 1of 2

CS304 GDB Solution Spring 2022

GDB Topic:
Suppose you are working in the Data Security Department of a Software Architect
Company; the company signed a new project with Sapphire Group (a premier textile
group in Pakistan) last month.
You are assigned a New Task to add Credit Card Support to Sapphire E-
commerce Store, while developing credit card support, you have to deal with 2 similar
sections:

1. Add Credit Card Information.

2. Edit Credit Card Information.

Both these sections have similar data to store.

Identify the programming paradigm from the list given below and justify your answer
with proper reasoning.

· Object Oriented Programming Paradigm

· Procedural Programming Paradigm

Solution
I’ll use OOP (Object Oriented Programming) Paradigm for this scenario because of the
following reason:
Since the credit card info is a sensitive data, we don’t have to expose this data to
outside world so in OOP we can have a class with private data members which can be
used to hold credit card info and an interface/member’s function which will be used to
access and set values for credit card info.

Another reason is that we can reuse same code for add and edit operation using OOP
we can define setter function and we can perform both operation of edit & add using
same setters’ functions which in turn save us time and more manageable code for
future use.

You might also like