Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Magic 8 ball program using if/else

$
0
0
cout << down12
<< over3 << "Ask the magic 8 ball a yes or no question: ";
cin >> userAns; <-- this is their yes/no question. 

so if i want my answer to be most likely, do i write it like this?
system("PAUSE");
cout << down12;
if (compNum == userAns) <-- This is where i am confused. How do i get it so that this changes with each question?
{
cout << over3 << userAns
<< compNum << ".\n"
<< over3 << "most likely" << endl;
}

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>