Skip to content

Repository dedicated for the Object Oriented Programming course in ITI with Eng. Mahmoud Ouf and Eng. Muhammad Al-Gindy

License

Notifications You must be signed in to change notification settings

MuhammadNYoussef/ITI-CPP-OOP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ITI-CPP-OOP

Repository dedicated for the Object Oriented Programming course in ITI with Eng. Mahmoud Ouf and Eng. Muhammad Al-Gindy

LAB Question:

LAB #1:

  • Write Structure Employee (ID, Name, and Salary).
  • Make a pointer to the structure and allocate it with a number read by the user.
  • Fill the allocated array and then print it.
  • Make a function with default argument values and use it.
  • Try the scope operator.

LAB #2:

  • Convert your Employee structure to a class and all its data will be private(the name will be char *).
  • Write setter and getter for each property in your class (it must be public).
  • Write a swap function that takes a reference for two variables and swaps values.
  • Try function overloading and inline function.

LAB #3:

  • Write three constructors for your Employee class as you like.
  • Write the destructor of your Employee class.
  • Write the copy constructor of your Employee.
  • Write 2 functions with the following prototype:
    1. Employee FillEmp (int id, int Sal, char * name)
    2. void PrintEmp (Employee emp)
  • Trace your program using f7 key.

LAB #4:

  • Overload the +, =, ==, int, char *operators to do the following:
    1. Emp +Emp
    2. 1000 +Emp
    3. Emp+1000
    4. ”Ahmed”+Emp
    5. Emp+”Ahmed”
  • (int)Empreturns Employee id
  • (char *)Empreturns Employee name

LAB #5:

  • Add a class variables for your Employee
  • CompanyName -> with setter and gettter.
  • EmployeeConut -> with getter only (you know when to increment and decrement that count).
  • Create an array for Employee using different constructors for the array elements.
  • Write a class point.
  • Write a class Rectangle that HAS 2 points.
  • Write a member function in the Rectangle that gets its area.

LAB #6:

  • Write a class circle that knows 2 points and has radius as a member data with its constructors as you like.
  • Write setters for circle’s points.
  • Write a member function of class circle to get its radius (use Pythagorean Theorem).
  • Try to deal with your circle class in the main.
  • Write a person class that has id and name with setters and getters.
  • Write Employee class that inherits person




About

Repository dedicated for the Object Oriented Programming course in ITI with Eng. Mahmoud Ouf and Eng. Muhammad Al-Gindy

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages