1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <iomanip>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
int main()
{
int varinfo=0, varconst=0,x=0,d ;
string allthings [100][100];
string Nombres, Edad, Peso, Profesion, Estatura, Genero;
//conversion
int z =1;
std::string z2;
std::stringstream zout;
zout<<z;
z2=zout.str();
//while loop
while(z>0){
cout<<"What is your Name?"<<endl;
getline (cin,Nombres);
allthings[x][0]=Nombres;
cout<<"Are you male or female?"<<endl;
getline(cin,Genero);
allthings[x][1]=Genero;
cout<<"What is your age?"<<endl;
getline(cin,Edad);
allthings[x][2]=Edad;
cout<<"What is your Proffesion?"<<endl;
getline(cin,Profesion);
allthings[x][3]=Profesion;
cout<<"What is your height (cm)?"<<endl;
getline(cin,Estatura);
allthings[x][4]=Estatura;
cout<<"How much do you weight (lb)?"<<endl;
getline(cin,Peso);
allthings[x][5]=Peso;
cout<<endl;
cout<<"exit? yes= any key no= 0"<<endl;
getline(cin,z2);
cout<<"thank you...";
cout<<endl;
//in loop statement
if(z==0){
cout<<"please fill out the form again..."<<endl<<endl;x++;
}
}
//other
ofstream fileoutput("formade.txt");
fileoutput<<Nombres<<endl<<"You are a: "<<Genero<<endl<<"Your Proffesion is: "<<Profesion<<endl<<"You weight: "<<Peso<<endl<<"Your height is: "<<Estatura<<endl;
fileoutput<<allthings;varinfo++;varconst++;
fileoutput.close();
//other
cout<<"What do you want to know about yourself?"<<endl<<"0-5"<<endl;
cin>>d;
cout<<allthings[x][d];
return 0;
}
|