Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Daffodil International University

Department of Software Engineering


Faculty of Science & Information Technology
Midterm Exam Examination, Fall 2020 @ DIU Blended Learning Center
Course Code: SE311, Course Title: Design Pattern
Level: 3 Term: 1 Section: PC-A
Instructor: SFR Modality: Open Book Exam
Date: Tuesday 10 November, 2020 Time: 02:00 PM - 06:00 PM
Four hours (4:00) to support online open/case study-based assessment Marks: 25
Directions
▪ Students need to go through the CASE STUDY shown in this exam paper.
▪ Analyze and answer specific section based on your own thinking and work.
▪ Do not share as this will be treated as plagiarism by Blended Learning Center.

Answer All the Questions

1. Assume you are working for an international company as a Software Engineer. Your company is
now developing a Bank Management System for a large private bank. Your team has been assigned
to develop the features related to Credit Card. Now, the team leader has allocated you for developing
a special feature and that is when a user punches their card into the system, they will be able to see
all the facilities according to their Card Type. Different card holders enjoy different special offers
according to their card type. The user requirements for the allocated job is given below:
i. User will enter their credit card number. (Ex. 4000-1234-5678-9010)
1. If the first 4 digit is 4000, then the card type is “Platinum”
2. If the first 4 digit is 3000, then the card type is “Gold”
3. If the first 4 digit is 2000, then the card type is “Classic”
ii. After entering their Card Number, user will be presented with a menu screen where he
will be able to choose his next action.
1. User can view their own card type.
2. If user choses to check his credit limit (The maximum amount of money a card
holder can spend), the program should display amount of money user’s can
spend.
3. If user choses to perform a transaction, take input the amount of money and the
destination card number, then deduct the amount of money from the credit limit
and display a message on the screen. (Ex. 500 BDT has been sent to 3000-6532-
1245-9867. Your new credit limit is 1500 BDT)
4. User can check their annual charge for their credit card. Annual charge is
different for different types of card.
5. If user choses to check special offers, the program will display special offers
that is available to the user according their card.

Now you are required to develop the program that will meet the user’s satisfaction.
Instructions
i. You have to create individual class for individual Card Types.
ii. You may assign random credit limit while creating Credit Card object for each user.
iii. You can assign random value for annual fees for each types of card.
iv. You need to show 4 Special Offers for each type of card, you can hardcode the offers in
the class itself. You may collect offers from online or come-up with your imagination.
v. Classes need to have 4 functions – getCardType(), checkCreditLimit(),
makeTransactions(), showSpecialOffers().

a. Which design pattern is appropriate for developing the solution of the problem stated? [3]
Defend your answer.

b. Analyze the problem and design the class diagram required for developing the [4]
program.
c. Develop the program in Java implementing the pattern according to your class [7]
diagram that you build in the previous step.

2. Suppose, you are working in the IT section of company. Let’s think about the customer who has
multiple Windows-based (Desktop) applications currently in use for different financial purposes.
Now, they want you to provide a solution to add the printing feature in all the applications they have.
The printing library or class can be accessed in a shared-basis by all the computers as each computer
add printing job in the printing queue and then each job is being executed resulting printed
documents.

Instructions
i. Create a Print class that will handle all the printing mechanism.
ii. Print class should have 3 functions – addPrintingJobs(), viewAllPrintingJobs(),
ExecutePrintingJobs().
iii. addPrintingJobs(String FileName): The function should take input a document name
and add it in a list of Queue List.
iv. viewAllPrintingJobs(): The function should display all the jobs queued in the list. (Ex.
1. ExamQuestion.pdf is waiting to be printed
2. Solutions.pdf is waiting to be printed
)
v. ExecutePrintingJobs(): This function should take the 1st item from the queue and
display message in the screen. (Ex. ExamQuestion.pdf is printed.)
a. Which design pattern is appropriate for developing the solution of the problem stated? [2]
Defend your answer.

b. Analyze the problem and design the class diagram required for developing the [3]
program.

c. Develop the program in Java implementing the pattern according to your class [6]
diagram that you build in the previous step.

You might also like