NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include "Contact.cpp"
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(){

string choice;

string type;
string name;
string phone
string mobilephone;
string fax;
string adress;
string city;
string email;

int girissayisi=0;
int kisisayisi=0;
int sirketsayisi=0;
int sirketist=0;
int kisiist=0;
int emailsayisi=0;
int kontrol1=0;
int kontrol2=0;
int kontrol3=0;
int i=0;
int sıra1=0;
int sıra2=0;


Contact nesne("-1","-1","-1","-1","-1","-1","-1","-1"); //ici bos
Contact temp("-1","-1","-1","-1","-1","-1","-1","-1"); //ici bos

Contact nesne1=nesne;
Contact nesne2=nesne;
Contact nesne3=nesne;
Contact nesne4=nesne;
Contact nesne5=nesne;
Contact nesne6=nesne;
Contact nesne7=nesne;
Contact nesne8=nesne;
Contact nesne9=nesne;
Contact nesne10=nesne;

Contact nesne11=nesne;
Contact nesne12=nesne;
Contact nesne13=nesne;
Contact nesne14=nesne;
Contact nesne15=nesne;
Contact nesne16=nesne;
Contact nesne17=nesne;
Contact nesne18=nesne;
Contact nesne19=nesne;
Contact nesne20=nesne;

Contact kayit[20];





do{

cout<<"nMenu:n"<<"--------n"<<"1-Create a Contactn"<<"2-Get Infon"<<"3-Set Phone Infon"<<"4-Set Email Infon"<<"5-Statisticsn"<<"---------n"<<"Enter your choice: "<<endl;
cin>>choice;

if(choice=="1"){

if(count_entry=>20)
cout<<"You can not entry more than 20!";
else{


cout<<"Please enter the contact of type (company/person):"<<endl;
cin>>type;

while((type!="company") && (type !="person")){
cout<<"Type info is mandotory.Please enter the proper contact of type(company/person): "<<endl;
cin>>type;
}

if(type=="company"){
++count_company;
cout<<"Please enter the company name: "<<endl;
cin>>name;
while(name==""){
cout<<"Name info is mandotory.Please enter your name:"<<endl;
cin>>name;
}
nesne.setType(type);
nesne.setName(name);
}
else if(type=="person"){
++count_person;
cout<<"Please enter the person name: "<<endl;
cin>>name;
while(name==""){
cout<<"Name info is mandotory.Please enter your name:"<<endl;
cin>>name;
}

nesne.setType(type);
nesne.setName(name);
}


cout<<"Please enter city info:"<<endl;
cin>>city;
if(city == "")
nesne.setCity("-1");
else
nesne.setCity(city);

cout<<"Please enter adress info:"<<endl;
cin>>adress;
if(adress=="")
nesne.setAdress("-1");
else
nesne.setAdress(adress);

cout<<"Please enter phone number info:"<<endl;
cin>>phone_no;
if(phone_no=="")
nesne.setPhoneNo("-1");
else
nesne.setPhoneNo(phone_no);

cout<<"Please enter mobile phone number info:"<<endl;
cin>>mobile_phone_no;
if(mobile_phone_no=="")
nesne.setMobilePhoneNo("-1");
else
nesne.setMobilePhoneNo(mobile_phone_no);

cout<<"Please enter fax number info:"<<endl;
cin>>fax_no;
if(fax_no=="")
nesne.setFaxNo("-1");
else
nesne.setFaxNo(fax_no);

cout<<"Please enter email info:"<<endl;
cin>>email;
if(email=="")
nesne.setEmail("-1");
else
nesne.setEmail(email);

++count_entry; // 20 kayıt daha yapılabilir.

if((nesne.getType()=="company")&&(nesne.getPhoneNo()!="-1")&&(nesne.getFaxNo()!="-1")&&(nesne.getMobilePhoneNo()!="-1")&&(nesne.getEmail()!="-1"))
++count_company_info;

if((nesne.getType()=="person")&&(nesne.getPhoneNo()!="-1")&&(nesne.getFaxNo()!="-1")&&(nesne.getMobilePhoneNo()!="-1")&&(nesne.getEmail()!="-1"))
++count_person_info;

kayit[i]=nesne; //oluşturulan contact kaydedildi
++i;

}
}
else if(choice=="2"){

cout<<"Please write Contact's type and name to get info:"<<endl;
cout<<"Type: ";
cin>>type;
cout<<endl;
cout<<"Name: ";
cin>>name;
do{
while((type!="company") && (type !="person")){
cout<<"Type info is mandotory.Please enter the proper contact of type(company/person): "<<endl;
cin>>type;
}



count_kontrol1=0;
for(int kontrol1=0;kontrol1<20;++kontrol1){
temp=kayit[kontrol1];
if((name!=temp.getName())||(type!=temp.getType()))
++count_kontrol1;
}
if(count_kontrol1==20){
cout<<"The name can not found.Please enter the type and name again"<<endl;
cout<<"Type:"<<endl;
cin>>type;
cout<<"Name:"<<endl;
cin>>name;
}
}while(count_kontrol1==20);

cout<<endl;
for(int k=0;k<20;k++){
temp=kayit[k];
if((temp.getName()==name)&&(temp.getType()==type))
nesne=kayit[k];
}

cout<<"Type: "<<nesne.getType()<<endl;
cout<<"Name: "<<nesne.getName()<<endl;
cout<<"City: "<<nesne.getCity()<<endl;
cout<<"Adress: "<<nesne.getAdress()<<endl;
cout<<"PhoneNo: "<<nesne.getPhoneNo()<<endl;
cout<<"MobilePhoneNo: "<<nesne.getMobilePhoneNo()<<endl;
cout<<"FaxNo: "<<nesne.getFaxNo()<<endl;
cout<<"Email: "<<nesne.getEmail()<<endl;

}

else if(choice=="3"){

cout<<"Please write Contact's type and name to setPhoneInfos:"<<endl;
cout<<"Type: ";
cin>>type;
cout<<endl;
cout<<"Name: ";
cin>>name;
//////////////////////////tip-isim kontrol
do{
while((type!="company") && (type !="person")){
cout<<"Type info is mandotory.Please enter the proper contact of type(company/person): "<<endl;
cin>>type;
}



count_kontrol2=0;
for(int kontrol2=0;kontrol2<20;++kontrol2){
temp=kayit[kontrol2];
if((name!=temp.getName())||(type!=temp.getType()))
++count_kontrol2;
}
if(count_kontrol2==20){
cout<<"The name can not found.Please enter the type and name again"<<endl;
cout<<"Type:"<<endl;
cin>>type;
cout<<"Name:"<<endl;
cin>>name;
}
}while(count_kontrol2==20);
///////////////////////////////////
cout<<endl;
for(int f=0;f<20;f++){
temp=kayit[f];
if((temp.getName()==name)&&(temp.getType()==type))
nesne=kayit[f];
else
++bellek1;
}



cout<<"Please enter phone number info:"<<endl;
cin>>phone_no;
if(phone_no=="")
nesne.setPhoneNo("-1");
else
nesne.setPhoneNo(phone_no);

cout<<"Please enter mobile phone number info:"<<endl;
cin>>mobile_phone_no;
if(mobile_phone_no=="")
nesne.setMobilePhoneNo("-1");
else
nesne.setMobilePhoneNo(mobile_phone_no);

cout<<"Please enter fax number info:"<<endl;
cin>>fax_no;
if(fax_no=="")
nesne.setFaxNo("-1");
else
nesne.setFaxNo(fax_no);

kayit[bellek1]=nesne;
bellek1=0;
}



else if(choice=="4"){

cout<<"Please write Contact's type and name to setEmail:"<<endl;
cout<<"Type: ";
cin>>type;
cout<<endl;
cout<<"Name: ";
cin>>name;
do{
while((type!="company") && (type !="person")){
cout<<"Type info is mandotory.Please enter the proper contact of type(company/person): "<<endl;
cin>>type;
}



count_kontrol3=0;
for(int kontrol3=0;kontrol3<20;++kontrol3){
temp=kayit[kontrol3];
if((name!=temp.getName())||(type!=temp.getType()))
++count_kontrol3;
}
if(count_kontrol3==20){
cout<<"The name can not found.Please enter the type and name again"<<endl;
cout<<"Type:"<<endl;
cin>>type;
cout<<"Name:"<<endl;
cin>>name;
}
}while(count_kontrol3==20);


cout<<endl;
for(int k=0;k<20;k++){
temp=kayit[k];
if((temp.getName()==name)&&(temp.getType()==type))
nesne=kayit[k];
else
++bellek2;
}



cout<<"Please enter email info:"<<endl;
cin>>email;
cout<<endl;
if(email=="")
nesne.setEmail("-1");
else
nesne.setEmail(email);

kayit[bellek2]=nesne;
bellek2=0;
}

else if(choice=="5"){

for(int basla=0;basla<20;basla++){ //tüm kayıtlardaki mail adresilerinin kontrolü
nesne=kayit[basla];
if((nesne.getEmail()!="-1")&&(nesne.getPhoneNo()=="-1")&&(nesne.getFaxNo()=="-1")&&(nesne.getMobilePhoneNo()=="-1")&&(nesne.getAdress()=="-1")&&(nesne.getCity()=="-1"))
++count_email;
}

cout<<"-Total Number of Contacts: "<<(count_person+count_company)<<endl;
cout<<"-number of company contacts: "<<count_company<<endl;
cout<<"-number of person contacts: "<<count_person<<endl;
cout<<"-Companies who have all the phone, mobile, fax and email info: "<<count_company_info<<endl;
cout<<"-Persons who have all the phone, mobile, fax and email info: "<<count_person_info<<endl;;
cout<<"-Those who only email address: "<<count_email<<endl;

count_email=0; //bir sonraki istatistikte temizlemek için
}


}while((choice!="-1")); // choice=-1 olunca kayıt bitti anlamındadır.







}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.