Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Address Book
//g++ 7.4.0 //the AdressBook // created by Rezaul Hoque on Dec 28, 2020 //contact at jewelmrh@yahoo.com #include <iostream> #include <string> using namespace std; class Ad { private: string first; string last; string street; string country; string city; double code; public: Ad() {}//default constructor Ad( string fn, string ln, string st, string ct, string con, double cod) { first = fn; last=ln; street=st; city=ct; country =con; code=cod;}//5 string and 1 double constructor Ad(Ad& c){ first=c.first; last=c.last; street =c.street; city=c.city;country =c.country;code=c.code;}//copy constructor ~Ad(){}//destructor virtual string getFn() const { return first;} virtual string getLn() const { return last;} virtual string getSt() const { return street;} virtual string getCt() const { return city;} virtual string getCon() const { return country;} virtual int getCod() const { return code;} }; int main () { const int max=5; Ad * Add; Add = new Ad[max]; Add[0]={"Aa", "Bb","123 nowhere","neverville","notopia",0000}; Add[1]={"Dd", "Cc","23 outonowere","nocity","notopia",00000}; Add[2]={"Nn", "Pp","32 nonexist","vanish","zeropublic",000}; Add[3]={"Zz", "Vv","56 nost","noville","neveristan",00}; Add[4]={"Tt", "Bb","67 nocity","utoville","neverland",0}; cout<<"First & Last Name Street City Country Postal Code:\n"; for(int i=0; i<max; i++) { cout<<"\n"; cout<<Add[i].getFn()<<"\t"; cout<<Add[i].getLn()<<"\t"; cout<<Add[i].getSt()<<"\t"; cout<<Add[i].getCt()<<"\t"; cout<<Add[i].getCon()<<"\t"; cout<<Add[i].getCod()<<"\t"; cout <<endl; } delete [] Add; return 0; }
run
|
edit
|
history
|
help
0
word shufle match
Vector impl
find duplicate in O(n)
Game
printAllPathsInMatrix
ConvHull
Equilateral triangle
TraceMarrix
lab17feb22x4B.cpp
Prime Factor