Television Program : OOMP OOMP Edit #include using namespace std; class tv{ int model,size; float price; public: void reset(); friend ostream &operator<<(ostream &output,tv &t){ output<<"\nModel No.: "<>(istream &input,tv &t){ cout<<"\nEnter model no.: \n"; input>>t.model; if(t.model>9999) throw 1; cout<<"\nEnter Size: \n"; input>>t.size; if(t.size<12 || t.size>70) throw 2; cout<<"\nEnter Price: \n"; input>>t.price; if(t.price>5000) throw 3; return input; } }; void tv::reset(){ model=0; price=0.0; size=0; } int main(){ tv t1; try{ cin>>t1; cout< SHARE SHARE SHARE RELATED POSTS
Blogger Comment
Facebook Comment