65 Fa 911 e 323 B 3 Assignment 1
65 Fa 911 e 323 B 3 Assignment 1
Assignment # 1
Note: The Submission date for this assignment is Friday (26-03-2024) 11:59 PM on
QOBE.
Task 1:
Write a C++ program that demonstrates the use of pointers to swap the values of two integers without using
a temporary variable.
Task 2:
Create a C++ class named "Rectangle" with private attributes for length and width. Implement member
functions to calculate the area and perimeter of a rectangle. Write a program that uses this class to create
two rectangle objects and display their properties.
Task 3:
Design a C++ class called "Person" with attributes for name and age. Implement a default constructor and
a parameterized constructor to initialize these attributes. Create an object of the "Person" class using both
constructors and display the person's information.
Task 4:
Extend the "Rectangle" class from Question 2 by adding default and parameterized constructors for setting
the length and width. Test the class by creating objects using both types of constructors and displaying their
properties.
Task 5:
Create a C++ class named "StaticArray" that contains a static integer array. Implement both shallow copy
constructors and deep copy constructors for this class, showcasing the difference between shallow and deep
copy when copying objects of this class.
Task 6:
Develop a C++ program to create a class called "Student" with attributes for name, roll number, and a static
array of test scores. Implement member functions to calculate the average score and display the student's
information. Use a static array to store the test scores.
Task 7:
Design a C++ program to create a class called "BankAccount" with attributes for an account number,
account holder's name, and the account balance. Implement member functions to deposit and withdraw
money from the account, and display the account information. Create an array of `BankAccount` objects,
and demonstrate the operations on these accounts in your program.
Note: Marks will be marked on the basis of Written Viva (As discussed in the Class).