The document outlines a list of experiments for a lab course on Problem Solving Using Advanced Python at the Noida Institute of Engineering and Technology for the semester 2020-2021. It includes various programming tasks involving class definitions, constructors, methods for mathematical operations, and data handling for different entities like students and employees. Each experiment focuses on implementing specific functionalities using Python classes and methods.
The document outlines a list of experiments for a lab course on Problem Solving Using Advanced Python at the Noida Institute of Engineering and Technology for the semester 2020-2021. It includes various programming tasks involving class definitions, constructors, methods for mathematical operations, and data handling for different entities like students and employees. Each experiment focuses on implementing specific functionalities using Python classes and methods.
1. Write a program illustrating class definition and accessing class members.
2. Write a program to implement default constructor, parameterized constructor, and destructor. 3. Create a Python class named Rectangle constructed by a length and width. a. Create a method called area which will compute the area of a rectangle. 4. Create a class called Numbers, which has a single class attribute called MULTIPLIER, and a constructor which takes the parameters x and y (these should all be numbers). a. Write an instance method called add which returns the sum of the attributes x and y. b. Write a class method called multiply, which takes a single number parameter a and returns the product of a and MULTIPLIER. c. Write a static method called subtract, which takes two number parameters, b and c, and returns b - c. d. Write a method called value which returns a tuple containing the values of x and y. 5. Create a class named as Student to store the name and marks in three subjects. Use List to store the marks. a. Write an instance method called compute to compute total marks and average marks of a student. b. Write a method called display to display student information. 6. Create a class Employee that keeps a track of the number of employees in an organization and also stores their name, designation and salary details. a. Write a method called getdata to take input (name, designation, salary) from user. b. Write a method called average to find average salary of all the employees in the organization. c. Write a method called display to print all the information of an employee. 7. Create a Python class named Circle constructed by a radius. Use a class variable to define the value of constant PI. a. Write two methods to be named as area and circum to compute the area and the perimeter of a circle respectively by using class variable PI. b. Write a method called display to print area and perimeter. 8. Create a class called String that stores a string and all its status details such as number of uppercase letters, lowercase letters, vowels ,consonants and space in instance variables. a. Write methods named as count_uppercase, count_lowercase, count_vowels, count_consonants and count_space to count corresponding values. b. Write a method called display to print string along with all the values computed by methods in (a). 9. Write a program that has a class called Fraction with attributes numerator and denominator. a. Write a method called getdata to enter the values of the attributes. b. Write a method show to print the fraction in simplified form. 10. Write a program that has a class Numbers with a list as an instance variable. a. Write a method called insert_element that takes values from user. b. Write a class method called find_max to find and print largest value in the list. 11. Write a program that has a class Point with attributes x and y. a. Write a method called midpoint that returns a midpoint of a line joining two points. b. Write a method called length that returns the length of a line joining two points. 12. Create a class called Complex. Write a menu driven program to read, display, add and subtract two complex numbers by creating corresponding instance methods. 13. Write a Program to illustrate the use of __str__(), __repr__(), and __new__ metods. 14. Create a BankAccount class. Your class should support the following methods: a. __init__(self, account_no) b. deposit (self, account_no, amount) c. withdraw (self, account_no, amount) d. get_balance (self, account_no) 15. Write a program to illustrate the use of following built-in methods: a. hasattr(obj,attr) b. getattr(object, attribute_name [, default]) c. setattr(object, name, value) d. delattr(class_name, name)