MCS 201

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

No.

of Printed Pages : 4 MCS-201

POST GRADUATE DIPOLOMA IN


COMPUTER APPLICATIONS
(PGDCA) (NEW)
Term-End Examination
December, 2022
MCS-201 : PROGRAMMING IN C AND PYTHON

Time : 3 Hours Maximum Marks :100

Weightage : 70%

Note : Question No. 1 is compulsory. Attempt any


three questions from the rest.

1. (a) Draw flowchart and write algorithm to


print Fibonacci series upto the number of
terms entered by the user. 5

(b) Differentiate between the structure and


union construct in C. Write suitable code
for each. 5

(c) Compare the term typedef and typecast in


C. Give suitable code for each. Also discuss
utility of both. 5

P. T. O.
[2] MCS-201

(d) Write a program in C to verify that the


string entered by the user is palindrome or
not. Support your program with suitable
comments. 5
(e) What is Jython ? How does Jython work ?
Compare module and package in context of
Python. 5
(f) What are generators in Python ? Compare
generators and lists. Also discuss utility of
generators in Python. 5
(g) What are iterators in Python ? How do
iterators differ from iterables ? Give
example of each. 5
(h) What are co-routines ? How do co-routines
support cooperative multitasking in
Python ? 5

2. (a) Write an algorithm to find the slope of a


line segment whose end point coordinates
are (x 1 , y 1 ) and (x 2 , y 2 ). The algorithm
gives output whether the slope is positive,
negative or zero. Transform your algorithm
into C program. 10
Note : Slope of line segment = (y 2 – y 1 )/
(x 2 – x 1 ).
[3] MCS-201

(b) What are Pandas ? Write steps to import,


read and print a CSV file using Pandas.
Also, transform your steps in to suitable
code in Python. 10

3. (a) Write short notes on the following : 10


(i) Looping constructs and its types in C
(ii) Functions and its types in C
Give suitable example for each.
(b) Discuss the connect( ) method of MySQL.
Connector interface. List the arguments
involved with connect( ) method. Write
Python code to create database
student_DB and to connect to student_DB
(make suitable assumptions wherever
necessary). 10

4. (a) Write a program in C to calculate the


product of two matrices. Support your code
with suitable comments. 10
(b) What are lists ? How do lists differ from
arrays ? What do you understand by the
term “Lists are mutable but tuples are
immutable” ? Write syntax for creation of
list and accessing the last element of the
list. 10

P. T. O.
[4] MCS-201

5. (a) Briefly discuss the concept of “Call by


value” and “Call by reference”. Give
example code in C for each. Support your
code with suitable comments. 10

(b) Write Python code to perform the


following : 10

(i) Copy a file first.txt to second.txt

(ii) Reading a file

(iii) Writing to a file

(iv) Appending content to a file

MCS–201

You might also like