CODE
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int weapnum;
char yn[3];
// Start of Sig
cout << & #34;|===========================================================================
==|" << endl;
cout << "| |" << endl;
cout << "| Welcome to FEVERSTUDIOS RPG ItemMaker! |" << endl;
cout << "| |" << endl;
cout << & #34;|===========================================================================
==|" << endl;
cout << "| |" << endl;
cout << "| Use this program to help you create items for your RPG games! |" << endl;
cout << "| |" << endl;
cout << & #34;|===========================================================================
==|" << endl;
cout << "" << endl;
// End of Sig
system("PAUSE");
// Start of Item Genre List
cout << "Here is the list of items to pick from" << endl;
cout << "1. Swords" << endl;
cout << "2. Battle Axes" << endl;
cout << "3. Daggers" << endl;
cout << "4. 2 Handed Weapons" << endl;
cout << "5. Godly Weapons" << endl;
cout << "6. Staffs" << endl;
cout << "7. Admin Weapons" << endl;
system("pause");
// End of Item Genre List
// Start ItemMaker Directions
cout << "In the next step please press the number that is next to your Item Genre" << endl;
cout << "" << endl;
system("pause");
// Start of ItemMaker
cout << "What type of item do you want to make?" << endl;
cin >> weapnum;
cout << "Are you sure this is the correct number?" << weapnum;
cin >> yn;
if( yn == yes || yn == y ) {
system("pause");
}
system("PAUSE");
return EXIT_SUCCESS;
}
Ok, so now that you have seen my code I need to know how I can get a person to answer yes or no like here.
CODE
cout << "Are you sure this is the correct number?" << weapnum;
cin >> yn;
if( yn == yes || yn == y ) {
system("pause");
}
Can someone tell me what I'm doing wrong I have seemed to mess this up somehow? What I want this program todo is, Have a user enter their ItemGenre (Sword, Battle Axe, Staff etc...) then I want the program to ask if this is the right number? and if they type yes or y then I want it to run a set of code for example it generates a Sword name and stats.
Thanks in advance.