Software Engineering-1 (CS504)
Assignment # 4
Total marks = 20
Deadline Date = 19-01-2011
Please carefully read the following instructions before attempting the assignment.
Rules for Marking
It should be clear that your assignment would not get any credit if:
1) You should concern recommended books to clarify your concepts as handouts are not sufficient.
2) You are supposed to submit your assignment in .doc format. Any other formats like scan images, PDF, Zip, rar, bmp, docx etc will not be accepted
3) You are advised to upload your assignment at least two days before Due date.
4) This assignment file comprises of Two (2) pages.
Assignment comprises of 20 Marks. Note that no assignment will be accepted after due date via email in any case (whether it is the case of load shedding or emergency electric failure or internet malfunctioning etc.). Hence, refrain from uploading assignment in the last hour of the deadline, and try to upload Solutions at least 02 days before the deadline to avoid inconvenience later on.
For any query please contact: CS504@vu.edu.pk
Question No. 1 Marks 
This is a sample code for guessing your personality using if-else statement.
cout”Type a character in small letter [a-z] :”;
If (ch= =’l’)
cout”You are a Lucky person”;
else If (ch= =’a’ || ch==’z’)
cout”You are an extremist (sorry to say)”;
else If (ch= =’u’)
cout”You are Unlucky, wish you good luck.”;
cout”You are Unpredictable person”;
Your have to write a program that performs EXACTLY the same task using switch-statement.
Note: The code must be non-cryptic and easy to read.
Question No. 2 Marks 
Following code generates Fibonacci series for given limit number.
unsigned int i=0,j=0,sum=1,num;
cout”Enter the limit for the series ";
Modify the code such that the same objective is achieved by using Modular approach.
Hint: Define a function Fibonacci that takes series limit as input and prints the results.