address program prototype.

in programming •  7 years ago  (edited)

Hey steemit and steemians.

I brought you a simple program of address database. keep in mind its a prototype program.

LETS BEGIN:

Program Body: 

#include <iostream>

using namespace std;

int main(){

struct house{

int houseno;

string housename;

int streetno;

};

house ali,ahmed;

ali.houseno=887;

ali.housename="Sardar house";

ali.streetno=07;

ahmed.houseno=699;

ahmed.housename="Abbasi house";

ahmed.streetno=05;

int a;

cout<<"enter house number"<<endl;

cin>>a;

switch(a){

case 887:{

cout<<"house name is ="<<ali.housename<<endl;

cout<<"house number is ="<<ali.houseno<<endl;

cout<<"street number is ="<<ali.streetno<<endl;

break;

}

case 699:{

cout<<"house name is ="<<ahmed.housename<<endl;

cout<<"house number is ="<<ahmed.houseno<<endl;

cout<<"street number is ="<<ahmed.streetno<<endl;

break;

default:{

cout<<"not matched "<<endl;}

}

};

}

Limitations:

this program is very limited you just can access two house those are stored but storing more is no problem just gotta copy and change names and you are good to go.

Improvements:

I think I should place an option of crating an address, more options of a single address, convert this structure program to object oriented program.

Give me more suggestions how to improve in comment section below.

follow me @learnandgrow

THANK YOU ALL.




Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

You got a 3.19% upvote from @postpromoter courtesy of @learnandgrow!

Thank you for Using #promo-steem tag, Promote steemit by inviting your friends and your family!

This post has received a 4.79 % upvote from @boomerang thanks to: @learnandgrow

@boomerang distributes 100% of the SBD and up to 80% of the Curation Rewards to STEEM POWER Delegators. If you want to bid for votes or want to delegate SP please read the @boomerang whitepaper.

You got a 0.95% upvote from @upme requested by: @learnandgrow.
Send at least 1.5 SBD to @upme with a post link in the memo field to receive upvote next round.
To support our activity, please vote for my master @suggeelson, as a STEEM Witness