I'm sorry, I'm green as grass to C++. I do have experience with Basic4Gl and some regular and visual Basic. I have a small test program set up to test out the things i've learned from the 1st 3 tutorials. These cover topics from variables up until loops. My program has a Do...While loops in it, the loop works, but I cannot get it to stop can somone please point out my problem?
Code:
#include <iostream>
using namespace std;
int main()
{
int age, number, yob;
char retry;
do {
cout<<"How old are you?\n";
cin>>age;
cin.ignore();
cout<<"What is your favorite number?\n";
cin>>number;
cin.ignore();
yob = 2008 - age;
if (age == 15) {
cout<<"So you're "<< age<<"? Awsome! You're the same age as me!\n";
}
else {
cout<<"So you're "<< age<<", were born in "<< yob<<", and you favorite number is "<< number<<".\n";
}
cout<<"Repeat, Y/N \n";
cin>>retry;
cin.ignore();
}
while ( retry = "Y"||"y" );
}