Object-oriented programming (oop) is a programming paradigm that represents the concept of “object” that have data fields (attributes that describe the object) and associated procedures known as methods. An object can be considered a “thing” that can perform a set of related activities. The set of activities that the object performs defines the object’s behaviour. […]
This is the solution for 2010 fall 4(b), 2007 Spring 4(b), 2010 Spring 3(b OR) PU BCA #include<iostream> using namespace std; class vector { float x;//real part float y;//imaginary part public: vector(){}//constuuctor 1 vector(float i,float j) { x=i; y=j; } vector operator+(vector); vector operator-(vector); void display(void); void display2(void); }; vector vector::operator+(vector c) { vector temp; […]
C++ defines some format flags for standard input and output, which can be manipulated with the flags, setf, and unsetf functions. For example, cout.setf(ios_base::left, ios_base::adjustfield); void stream::unsetf(fmtflags flags); The function unsetf() uses flags to clear the io_stream_format_flags associated with the current stream. #include <iostream.h> main() { ios_base::fmtflags original_flags = cout.flags(); cout<< 812<<‘|’; cout.setf(ios_base::left,ios_base::adjustfield); cout.width(10); cout<< […]