The University of Azad Jammu and Kashmir Department of Software Engineering

You might also like

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

THE UNIVERSITY OF AZAD JAMMU AND KASHMIR

DEPARTMENT OF SOFTWARE ENGINEERING

Subject: Software Design Architecture Class: 4th Semester Course Code: SE-3203
Course Instructor: Engr. Syed Waqas Ali Examination: Mid-term Max Marks: 30
Time Allowed: 2:00-5:00 Hours SUBJECTIVE Reg. No. : ___________

1 This examination is open book, Open notes, closed neighbors.

2. Answer all questions.

a. There is no choice.

b. You will have to answer correctly all questions in this examination to get the maximum possible marks.

3. Do not ask any questions about the contents of this examination from anyone.

a. If you think that there is something wrong with any of the questions, attempt it to the best of your
understanding.
b. If you believe that some essential piece of information is missing, make an appropriate assumption and use it to
solve the problem.

4. The paper must be handwritten on a paper sheet.

5. Every page of the answer sheet must contain the sheet no. and the registration no. of the student.

6. The answer sheet (after scanning and converting it into pdf format) must be submitted to the course instructor
via email (preferably) or WhatsApp within the stipulated time. (The paper timing is till 1400 hours, and must be
delivered back to the course instructor not later than 05:00 pm.) Late submission will graded as Zero.

7. The name of the PDF file should be in this format: Roll Number-:Student Name: Course Name

8. All answer sheets will be assessed for plagiarism (cheating/copying) and material found plagiarized/copied will
lead to the initiation of a cheating case against the involved students and will be graded as Zero Marks.

9. The first page of the answer sheet must contain the Name of the student, Session, Semester, Roll No.
Course Title and Course Code

10. The hardcopy of the answer sheet must reach the department by post not later than 8th of June 2021. (Address:
Course Instructor

Department of Software Engineering

University Of Azad Jammu and Kashmir, Chellah Campus. Muzaffarabad.)

11. Student must (Copy as it is) and sign the Departmental Honor Code on the first page of the answer sheet

Departmental Honor Code:

12. Email the handwritten paper to syedwaqas2000@gmail.com

I acknowledge the Departmental Honor Code and I hereby confirm that the submitted work is entirely my
own and I have not (i) used the services of any agency or person(s) providing specimen, model or ghostwritten
work in the preparation of the work I submit for this open book examination; (ii) given assistance in accessing this
paper or in providing specimen, model or ghostwritten work to other candidates submitting for this open-book
examination.

Student’s Signature :____________________________


Q No. 1: (CLO1) (5+5+5)
a) Explain Stepwise refinement and Structural design with example and discuss their importance.
b) How Product and Engineering design differs from each other .Write down any case study depicting these
designs.
c) Coupling and Cohesion are two important principles of software designing. Discuss which of coupling
and cohesion type is better in software designing and why. Discuss with any software product example.

Q No. 2: (CLO2) (15)


Design activity diagram from the code below
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdio.h>
class bank
{
long int accno;
char name[20];
char type; //no significance across the program
float balance;
public:
bank()
{
accno=0;
strcpy(name,"NA");
type=' ';
balance=0;
}
long int returnacc();
void deposit();
void withdraw();
void transfer();
void openacc();
void viewacc();
}c[5];
long int bank::returnacc()
{
return accno; //returns acc no of the object
}
void bank::deposit()
{
float amt;
cout<<"Enter amount: ";
cin>>amt;
balance+=amt;
cout<<"Rs. "<<amt<<" has been deposited to A/C No."<<returnacc();
cout<<"\nCurrent Balance - Rs."<<balance;
getch();
}
void bank::withdraw()
{
float amt;
cout<<"Enter amount: ";
cin>>amt;
if((balance-amt)>=5000)
{
balance-=amt;
cout<<"Rs. "<<amt<<" has been withdrawn from A/C No."<<accno;
cout<<"\nCurrent Balance: Rs."<<balance;
}
else
cout<<"Sorry! Insufficient balance.";
getch();
}
void bank::transfer()
{
long int acno;
float amt;
int flag=1;
cout<<"Enter A/C of receiver: ";
cin>>acno;
cout<<"Enter amount to be transferred: ";
cin>>amt;
if((balance-amt)>=5000)
{
for(int i=0; i<5; i++)
{
if(acno==c[i].returnacc())
{
flag=1;
balance-=amt; //amt subtracted from current user
c[i].balance+=amt; //amt added to receivers account
cout<<"Rs."<<amt<<" has been transfered to "<<acno;
cout<<"\nYour Current Balance: Rs."<<balance;
}
}
if(flag==0) cout<<"Account not found.";
}
else cout<<"Sorry! Insufficient Balance.";
getch();
}
void bank::openacc()
{
cout<<"A/C No.: ";
cin>>accno;
cout<<"Holder Name: ";
gets(name);
cout<<"A/C Type (S/C): ";
cin>>type;
cout<<"Opening Balance: ";
cin>>balance;
cout<<"The A/C of Mr./Mrs."<<name<<" has been opened.\n";
getch();
}
void bank::viewacc()
{
cout<<"\n\nAccount Details";
cout<<"\n A/C No.: #"<<accno;
cout<<"\n Holder Name: "<<name;
cout<<"\n Type: "<<type;
cout<<"\n Balance: "<<balance;
}
void createacc();
void login();
void manageacc(int);
/* MAIN PROGRAM */
void main()
{
int op;
/* ADMIN AREA */
do{
clrscr();
cout<<"E-BANKING PORTAL";
cout<<"\n1. Open a New A/C \n2. Manage A/C \n0. Exit";
cout<<"\nEnter Option: ";
cin>>op;
switch(op)
{
case 1: createacc(); break; //creates account
case 2: login(); break; //login to user area
case 0: cout<<"Thank you for banking with us"; getch(); break;
default: cout<<"Invalid Option. Try Again."; getch();
}
}while(op>0);
}
void createacc()
{
int n;
clrscr();
cout<<"No of Accounts to be created (<5): ";
cin>>n;
for(int i=0; i<n; i++)
{
cout<<endl;
c[i].openacc();
}
}
void login() //LOGIN BY A/C NO
{
clrscr();
long int ac;
int flag=0;
cout<<"Enter A/C No.: ";
cin>>ac;
for(int i=0; i<5; i++)
{
if(ac==c[i].returnacc())
{
manageacc(i);
flag=1;
}
}
if(flag==0) cout<<"Account Not Found. Try Again!.";
}
void manageacc(int i)
{
int op;
clrscr();
/* USER AREA */
cout<<"E-BANKING PORTAL - USER SESSION";
cout<<"\n1. Deposit \n2. Withdraw \n3. Transfer";
cout<<"\n4. View A/C Details \n0. Logout";
do{
cout<<"\nEnter Option: ";
cin>>op;
switch(op)
{
case 1: c[i].deposit(); break;
case 2: c[i].withdraw(); break;
case 3: c[i].transfer(); break;
case 4: c[i].viewacc(); break;
case 0: cout<<"You have been sucessfully logged-out.";
getch(); break;
default: cout<<"Invalid Option. Try Again."; getch();
}
cout<<endl;
}while(op>0);
}

The End

You might also like