Description
Course Code : MCS-201
Course Title : Programming in C and PYTHON
Assignment Number : PGDCA(I)/201/Assignment/2024
Maximum Marks : 100
Weightage : 30%
Last Date of Submission : 30th April, 2024 (for January session)
31st October, 2024 (for July session)
There are eight questions in this assignment (four in each section i.e. Section A and Section
B) which carries 80 marks. Each question carries 10 marks. Rest 20 marks are for vivavoce. Answer allthe questions from both the sections i.e. Section A and Section B. You may
use illustrations and diagrams to enhance the explanations. Include the screen layouts also
along with your assignment responses. Please go through the guidelines regarding
assignments given in the Programme Guide for the format of presentation.
SECTION-A (C-Programming)
Question 1: 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.
Question 2: Briefly discuss the relation between pointers and arrays, giving suitable example.
Write a program in C, to print transpose of a 2D matrix entered by a user. Also give
comments.
Question 3: Write an algorithm to find the slope of a line segment whose end point
coordinates are (x1, y1) and (x2, y2). The algorithm gives output whether the slope
is positive, negative or zero. Transform your algorithm into C program.
Note : Slope of line segment = (y2 – y1)/ (x2 – x1).
Question 4: Write an algorithm to find the HCF (Highest Common Factor) of
the two numbers entered by a user. Transform your algorithm into a C
program, support your program with suitable comments.
SECTION-B (PYTHON-Programming)
Question 1: 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).
Question 2: 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.
Question 3: Write steps to create a package. Apply these steps to create a package named
volume and create 3 modules in it named cube, cuboid and sphere, having
function to calculate volume of the cube, cuboid and sphere respectively. Import
the modules defined in the package and use the defined functions for calculation
of volume respectively.
4
Question 4: What does map( ) function do ? Write a program in Python to print the cube of
the numbers present in the list, by using map( ) function
Reviews
There are no reviews yet.