Hello guys i want to know how i can get the words in C++ like (a,b,c,d,f.....) im making dice game and when player will put word instead of number to tell him "You need to enter number!"
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
int dice;
int money=10;
int num;
int answer;
char roll;
{
cout<<"Your bank is $" << money << endl;
cout<<"Please enter your guess for the next roll. It only costs $1.00 to play, If you are correct I will pay you $100.00:" <<endl;
cin>>num;
cin.get(roll);
srand(time(NULL));
dice = (rand()%6)+1;
if(num > 6)
{
system("cls");
cout << "You can't enter hieger number of 6!" << endl;
cout << "Try again !" << endl;
system("PAUSE");
}
if (num == dice)
{
cout<<"Winner! The dice rolled " << dice <<endl;
money += 100;
cout << "Your bank acc is now $" << money << endl;
system("PAUSE");
}
else if (num != dice)
{
cout << "Sorry the dice rolled " << dice <<endl;
money -= 1;
cout << "Your bank acc is now $" << money << endl;
system("PAUSE");
}
}
return 0;
}