So a bit of what I am trying to do. I am trying to make a program that ask you for name and gender (age is always used lets use gender be deferent, and yes I hate doing hello world for the same reason )
and then ask if the information is correct and if it's not to redo it all.
Code:#include <iostream> #include <cstdlib> using namespace std; int main() { string my_name; string my_gender; string yes_no; cout<<"Welcome please type your name \n"; cin>> my_name; cout<<"Hello " << my_name << " and what gender are you?"; cin>>my_gender; cout<< "You are " << my_name << "and are a " << my_gender << "? /n"; cout<< "type yes or no"; cin>> yes_no;
After this line I had a few plans to make this work
A. loop if yes_no = no
B. loop while yes_ no = no
Looking at them I think they are the same thing but I could be wrong
and even so is one "bad programing" if so why?
Can strings even work this way? I see no reason why not but the error is making me think other wise, it says "no" is not declared but it should be with cin>> yes_no right?