/CPP-Assignments

Repository to track CPP Assignments

Primary LanguageC++

C++ Assignments

1. Create Student class with data members

  • RollNo
  • Name
  • Course

Implement the following

  • Default constructor
  • Parameterized constructor
  • Destructor
  • Function to accept data
  • Function for display data
  • Write main function and create array of students and store data of multiple students in array.
  • Write Function to find student by Roll No

2. Create Time class with data members

  • hours
  • minutes
  • seconds

implement following

  • Default constructor
  • Parameterized constructor
  • Destructor
  • Function for display data
  • Function to compare two time objects
  • Function to find out difference between two time objects

3. Create Date class with data members

  • dd
  • mm
  • yyyy

implement following

  • Default constructor
  • Parameterized constructor
  • Destructor
  • Function to find out difference between two dates
  • Function to compare dates
  • Separate header and implementation files
  • Overlaod ==, !=, +, - operator

4. Create Your own String class (Use class name as MyString) with data members

  • char * p;
  • int size;

Allocate memory dynamically for pointer and get size from user.

Implement followings

  • Default constructor
  • Parameterized constructor
  • Copy Constructor
  • Destructor for clean-up (use delete compulsory)
  • Display function.
  • Separate header and implementation files

5. Create Player class with data members

  • name
  • age
  • country

Implement followings

  • Default constructor
  • Parameterized constructor
  • Function to Sort Array of Player objects (implement as global, sorting should be one name and age)
  • Accept Function for data input
  • Display function for data display
  • Separate header and implementation files
  • In main function create array of player objects and pass it to Sort function and print sorted player list

6. Create Address class with data members

  • HouseNo
  • Colony
  • Area
  • City
  • Pincode

Implement followings

  • Default constructor
  • Parameterized constructor
  • Accept Function for data input
  • Display function for data display
  • Separate header and implementation files
  • Write function to find whether two addresses are same or different.
  • Overlaod == operator

7. Create Payslip class with data members

  • EmpNo
  • EmpName
  • DA
  • HRA
  • BasicSalary

Implement followings

  • Default constructor
  • Parameterized constructor
  • Accept Function for data input
  • Display function for data display
  • Function to calculate salary from DA, HRA and Basic Salary
  • Separate header and implementation files

8. Create MobilePhone class with data members

  • ModelNo
  • Price
  • Manufacturer
  • Quantity

Implement followings

  • Default constructor
  • Parameterized constructor
  • Accept Function for data input
  • Display function for data display
  • Function to search MobilePhone model availability
  • Write menu driven program with following menus
  • Add Mobile
  • Display List of available mobiles
  • Find out quantity of particular mobile type
  • Find out availability of Particular model