A A A A: Const Const
A A A A: Const Const
Lab 05
Topic Covered: Returning Objects and Objects Passing By Reference
i j k
|
| A × B|= Ai
Bi
Aj
Bj |
Ak
Bk
1
Similarly
Make Vector Sub( const Vector& B) const to subtract two
Vector objects
Make Vector Add( const Vector& B) const to add two Vector
objects
Remember to write functions declaration inside the class and
functions definition outside the class.
Also make three separate files Vector.h, Vector.cpp and main.cpp
Make three Vector objects in main() and call these functions to
check their working.
In the main function take inputs for two vectors from user
Ask the user what type of operation he/she wants to perform.
Apply that operation and show the answer on screen.