OOP'S - BSC IT PRACTICALS

OOP'S

Syllabus :



List Of Practicals : To Be Implemented Using Object Oriented Language

1.  Classes and methods
a.  Design an employee class for reading and displaying the employee information, the getInfo() and displayInfo() methods will be used repectively. Where getInfo() will be private method
b.  Design the class student containing getData() and displayData() as two of its methods which will be used for reading and displaying the student information respectively.Where getData() will be private method.
c.  Design the class Demo which will contain the following methods: readNo(), factorial() for calculating the factorial of a number, reverseNo() will reverse the given number, isPalindrome() will check the given number is palindrome, isArmstrong() which will calculate the given number is armStrong or not.Where readNo() will be private method.
d.  Write a program to demonstrate function definition outside class and accessing class members in function definition.

2.  Using friend functions.
a.  Write a friend function for adding the two complex numbers, using a single class
b.  Write a friend function for adding the two different distances and display its sum, using two classes.
c.  Write a friend function for adding the two matrix from two different classes and display its sum.

3.  Constructors and method overloading.
a.  Design a class Complex for adding the two complex numbers and also show the use of constructor.
b.  Design a class Geometry containing the methods area() and volume() and also overload the area() function .
c.  Design a class StaticDemo to show the implementation of static variable and static function.

4.  Operator Overloading
a.  Overload the operator unary(-) for demonstrating operator overloading.
b.  Overload the operator + for adding the timings of two clocks, And also pass objects as an argument.
c.  Overload the + for concatenating the two strings. For e.g “Py” + “thon” = Python

5.  Inheritance
a.  Design a class for single level inheritance using public and private type derivation.
b.  Design a class for multiple inheritance.
c.  Implement the hierarchical inheritance.

6.  Virtual functions and abstract classes
a.  Implement the concept of method overriding.
b.  Show the use of virtual function
c.  Show the implementation of abstract class.

7.  String handling
a.  String operations for string length , string concatenation
b.  String operations for string reverse, string comparison,
c.  Console formatting functions.

8.  Exception handling
a.  Show the implementation of exception handling
b.  Show the implementation for exception handling for strings
c.  Show the implementation of exception handling for using the pointers.

9.  File handling
a.  Design a class FileDemo open a file in read mode and display the total number of words and lines in the file.
b.  Design a class to handle multiple files and file operations
c.  Design a editor for appending and editing the files

10.  Templates
a.  Show the implementation for the following
b.  Show the implementation of template class library for swap function.
c.  Design the template class library for sorting ascending to descending and vice- versa

DOWNLOAD PROGRAMS

Tools:
We used turbo c++ or c  to run above programs. You can also Download it.

Local Environment Setup :
If you are still willing to set up your environment for C++, you need following two softwares available on your computer.
Text Editor
This will be used to type your program. Examples of few editors include Windows Notepad, OS Edit command, Brief, Epsilon, EMACS, and vim or vi.
Name and version of text editor can vary on different operating systems. For example, Notepad will be used on Windows and vim or vi can be used on windows as well as Linux, or UNIX.
The files you create with your editor are called source files and for C++ they typically are named with the extension .cpp, .cp, or .c.
Before starting your programming, make sure you have one text editor in place and you have enough experience to type your C++ program.
C++ Compiler
This is actual C++ compiler, which will be used to compile your source code into final executable program.
Most C++ compilers don't care what extension you give your source code, but if you don't specify otherwise, many will use .cpp by default
Most frequently used and free available compiler is GNU C/C++ compiler, otherwise you can have compilers either from HP or Solaris if you have respective Operating Systems



Turbo C++ Shortcuts
S.No.
Shortcuts keys
Action
1. 
F1
For Help
2. 
F2
Save
3. 
F3
Open
4. 
F4
Go to cursor
5. 
F5
Zoom
6. 
F6
Next
7. 
F7
Trace into
8. 
F8
Step over
9. 
F9
Make
10. 
F10
Menu
11. 
Alt+X
Quit
12. 
Alt+Bksp
Undo
 13.
Shift+Alt+Bksp
Redo
14. 
Shift+Del
Cut
15. 
Ctrl+Ins
Copy
16. 
Shift+Ins
Paste
17. 
Ctrl+Del
Clear
18. 
Ctrl+L
Search again
 19.
Alt+F7
Previous error
 20.
Alt+F8
Next error
21.
 Ctrl+F9 'or' Alt+R+Enter
Run
22. 
Ctrl+F2
Program reset
23. 
Alt+F9
Compile
24. 
Alt+F4
Inspect
25. 
Ctrl+F4
Evaluate/Modify
26. 
Ctrl+F3
Call stack
27. 
Ctrl+F8
Toggle breakpoint
28. 
Ctrl+F5
Size/Move
29. 
Alt+F3
Close
30. 
Alt+F5
User screen
31.
Alt+0
List all
32. 
Shift+F1
Index
33. 
Ctrl+F1
Topic search
34. 
Alt+F1
Previous topic
35. 
Ctrl+F7
Add watch
36.
Alt+Enter
Toggle screen mode(Full Screen / Window)*
Learning Resources:
BOOKS:
                      Mastering C++ - K R Venugopal
                      Object Oriented Programming With C++ - E Balagurusamy

1 comment: