Purbanchal University
Sixth Semester
Advanced Computer Programming

Advanced Computer Programming

Year: III Semester: VI

Teaching Hours/week Examination Scheme Total Marks
Internal Final
Theory Practical Theory Practical
Cr L T P Duration Marks Duration Marks
3 3 3 - 40 3 hrs 60 100

Course Description: The course covers the basic and Object Oriented programming using Python programming language.

Course Objectives: The main objective of this course is to understand basic and advanced features of Python programming such as database connectivity, multithreading, data analysis, image processing, etc.


Chapter 1: Introduction to Python (4 hrs)

History of Python, unique features of Python, Python identifiers, keywords and indentation, comments,
Command line arguments, getting input from user, data types, variables, operators, Python code objects and functions, Numbers and Maths.

Chapter 2: Control Statements (4 hrs)

Python if statement, if-else statement, elif statement. Python loops: while loop, for loop, nested loop. Examples involving loops.

Chapter 3: List, Ranges and Tuples in Python (4 hrs)

Lists in Python, understanding iterators, Python dictionary, sets, arrays.

Chapter 4: Python Object Oriented (8 hrs)

Overview of OOP, creating classes and objects, accessing attributes, built-in class attributes, destroying objects.

Chapter 5: Python Exception Handling (4 hrs)

Introduction to Exception, handling exceptions, use of keywords: try...except, else, try-finally. Argument to an exception, Python standard exceptions, raising an exception, user-defined exceptions.

Chapter 6: Python Multithreaded Programming (4 hrs)

Introduction, creating new thread, synchronizing threads, multithreaded priority queue.

Chapter 7: Using Database in Python (4 hrs)

Python MySQL Database Access, creating database connection, CREATE, INSERT, READ, UPDATE, DELETE operations.

Chapter 8: Python for Geospatial Data Analysis (8 hrs)

Introduction to NumPy, creating arrays, using arrays and scalars, indexing arrays, array transportation, universal array functions, array processing, array input and output. Introduction to Pandas, Pandas data structures: Series and DataFrame, geospatial raster and vector data, GPAL.

Chapter 9: Basic Data Visualization using Python (5 hrs)

Introduction to Matplotlib, scatter plot, line plot, bar chart, histogram.


Tutorial: (30 hrs)


References:

  1. Fabrizio Romano and Heinrich Kruger, Learn Python Programming. Introduction to the Fundamentals of Python, Third Edition, Packt Publication 2021.
  2. Kenneth A. Lampart, Fundamental of Python, Cengage Learning Publishing.
  3. Cody Jackson (2018): Learn Programming in Python with Coy Jackson, Packt Publishing, Wesley.
  4. Mark Summerfield: Programming in Python 3: A Complete Introduction to the Python Language.

Exercises:

  1. Write a Python program that calculates the area of a circle based on the radius entered by the user.
  2. Write a Python program that accepts the user's first and last name and prints them in reverse order with a space between them.
  3. Basic Data visualization: Write a Python program to extract the filename from a given path.
  4. Write a Python program to handle a Zero Division Error exception when dividing a number by zero.
  5. Write a Python program to draw Basic Data visualization from a given dataset.

Examination Scheme

Chapter Very short questions Short questions Long questions Total marks
No. of questions Marks No. of questions Marks No. of questions Marks
1 1 2 1 4 - - 6
2 - - 1 4 - - 4
3 1 2 1 4 - - 6
4 - - - - 1 10 10
5 1 2 1 4 - - 6
6 - - 1 4 - - 4
7 - - 2 8 - - 8
8 - - - - 1 10 10
9 1 2 1 4 - - 6
Total 4 8 8 32 2 20 60

Model Question

Very short questions [4×2 = 8]

  1. Explain the difference between formal and actual parameters with an example.
  2. Explain the basic idea behind a hash table with a suitable example.
  3. What is an operator? List arithmetic operators.
  4. Explain the raw_input() function with an example.

Short questions [8×4 = 32]

  1. How to implement threads in Python? Explain one method with a suitable example.
  2. Write a Python program to create a plot of years of compounding vs. value of principal using the pyplot library. Assume reasonable values for principal, interest rate, and years.
  3. Write a Python program to read line by line from a given file.
  4. What is an interpreter? How does the Python interpreter work?
  5. What is an exception? How can you handle exceptions in Python? Explain with an example.
  6. Write a program in Python to insert one record into a table. Assume a suitable schema for the table.
  7. Write a Python program to read a CSV file using Pandas.
  8. Write a Python program to implement isPalindrome() function to check if a given string is a palindrome.

Long questions [10×2 = 20]

  1. A. Explain Series in Pandas with a suitable example. Explain a time series plot with a suitable example.
    OR
    B. What is OOP? How can you create a class in Python? Write a program to implement a Student class with a method to calculate CGPA. Assume suitable class variables.

  2. Write short notes on Data Visualization. Write a program in Python for creating a histogram/pie chart.

Share this page: