The document outlines 6 programming tasks to implement classes and objects in C++. It includes tasks to create classes for shapes like circles and rectangles, with member functions to calculate areas and perimeters. It also includes tasks to create classes for people and boxes, with constructor functions and member functions to set/get variable values and display outputs.
The document outlines 6 programming tasks to implement classes and objects in C++. It includes tasks to create classes for shapes like circles and rectangles, with member functions to calculate areas and perimeters. It also includes tasks to create classes for people and boxes, with constructor functions and member functions to set/get variable values and display outputs.
Dept. of Computer Science & Engineering Batch: 73 (1st Shift) Semester: 6th Course Code: CSE-208 Course Title: Object Oriented Programming Lab Report-1 Task: A. Write a program to implement a class called Circle that has private member variables for radius. Include member functions to calculate the circle's area and circumference. B. Write a program to create a class called Person that has private member variables for name, age and country. Implement member functions to set and get the values of these variables. C. Write a program that defines a shape class with a constructor that gives value to width and height. The define two sub-classes triangle and rectangle, that calculate the area of the shape area (). In the main, define two variables a triangle and a rectangle and then call the area() function in this two variables. D. Write a program to declare class BOX private height, width, depth public declare 1 default constructor, 1 parameterized constructor and show() to display the values. Write main() function to declare an object to invoke all the constructor and show function for each object. E. Write a program to print the area and perimeter of a triangle having sides of 3, 4 and 5 units by creating a class named 'Triangle' with the constructor having the three sides as its parameters. F. Write a program which will calculate the area of circle and rectangle using a base class shape and derived classes circle and rectangle. *General instructions for writing lab reports** Students must submit a handwritten lab report for each lab session from now on; printed copies will not be evaluated. The cover page of the lab report should include the following information: 1. Lab course title. 2. Lab course code. 3. Lab Report No. 4. Submitted to: (teacher's full name with designation and department). 5. Submitted by: (student's full name with roll number and department). 6. Submission Date. The contents of the lab report have to cover the following points 1. Title (Lab problem Name). 2. Objectives (Make it short and specific and Start with ‘To’) 3. Code 4. Output 5. Discussion