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

Bahria University, Islamabad Campus

Department of Computer Science


Final Assessment
BSCS 1 A/B
(Spring 2020 Semester)

Course: Computer Programming Date/Time Assigned:21-06-2020 (2pm)


Course Code: Cscs-113 Submission Date/Time: 21-06-2020(8pm )
Faculty’s Name: Mahwish Pervaiz Max Marks: 40

___________________________________________________________________________

INSTRUCTIONS:
I. All questions are mandatory.
II. Provide complete screen shot of Program execution and Output Screen.
III. Cropped Screenshots of output screen will not be considered.
IV. Zero mark will be assigned in case of plagiarism.

Student Name: Enrollment No.

Questi on # 1 Marks=9+6
Part 1:

 Write a function that receive array of 10 string elements from main function and return
number of alphabet ‘e’ in complete array. Print result in main function.
For Example: If array received by function has following value. You have to check existence
of ‘e’ at each index and after traversing all index return the final count.

Insert Reference Review Design Layout

For Better understanding Occurrence of character ‘e’ has been marked with yellow. You
don’t have to mark them with yellow you just have to count all occurrences and return the
final count. Hint: Use nested Loop within function.

Part 2:
 Modify function implemented in part 1 and change its return type to void.
 Function should receive 2 parameters now: First is array of string and second is variable
count to store the number of occurrence of alphabet ‘e’ in array of string
 After execution of function print the value of count in main.

Page 1 of 2
Enrollment Number: ____________________________

Questi on # 2 2+2+5+6

 Create structure Arti cle having fi eld Arti cleTitle and PublishYear.
 Create another structure Researcher with fi elds R_Id of type int, R_Name of
type string , FieldOfRes earch of type String and Arti cleDetail of type
Arti cle .
 Create functi on that receive Array of 5 researcher and input values from
user.
 Create another functi on that that receive array of 5 researcher and display
R_Id, R_Name and Arti cleDetails of researcher whose PublishYear is 2000.

Questi on # 3 6+4

Part 1:
Write a program that declares variable num, a pointer ptr and a double
pointer dptr. Perform the following operati ons.
 Use ptr to store the value in num
 Use dptr to change the value store in num
 Use dptr to display the valur store in num

Part 2

 Declare an array of 10 integers and initi alize it.


 Declare a pointer and assign address of array to it.
 Use pointer to display value of 1st, 4th and 9 t h element in array. Don’t use
if conditi on.

End of Assessment
Best of Luck 

Page 2 of 2

You might also like