#include"stdafx.h"
#include<iostream>
#include<conio.h>
#include<string>
#include<Windows.h>
#include<dos.h>
#include<cstdlib>
#include<ctime>
usingnamespace std;
int playerInfo();
void drawline(int n, char symbol)
{
for (int i = 0; i<n; i++)
cout << symbol;
cout << "\n";
}
void wlcScrn()
{
system("cls");
drawline(60, '_');
cout << "\n\t\tWelcome to the Casino!\n";
drawline(60, '_');
playerInfo();
system("cls");
drawline(80, '=');
cout << "\n\nInstructions : ";
cout << "\n 1.Select a Number to Bid On.";
cout << "\n 2.Enter an Amount to Bid.";
cout << "\n 3.If the Number you Selected Comes Up, You Win Double Your Bid Amount.";
cout << "\n 4.If the Number you selected Doesn't Show Up, You lose Your Bid Amount.";
cout << "\n\nGood Luck";
drawline(80, '=');
_getch();
}
int playerInfo()
{
string plr;
int amount;
cout << "\nEnter Player Name - ";
cin >> plr;
cout << "\nOk , Lets start " << plr << ".";
cout << "\nEnter deposit amount (max-5000$) - ";
cin >> amount;
if (amount > 5000)
{
cout << "\nAmount Higher than 5000$, You're Kicked out of The Casino.";
_getch();
return 0;
}
else
{
cout << "\nYour Balance is " << amount << "$";
_getch();
}
}
void main()
{
wlcScrn();
}
In function playerInfo() I want That the Program quits if the user Enters a number more than 5000... But It doesn't do so... The program forwards to Instructions...Even I have put return 0; there....Please help and tell what should i do to further progress making my game.
Don't make multiple posts. You spend a lot of time drawing on the volunteers here who act in good faith and you are wasting our time and effort. You might like to take your questions to some other site to do your homework.
I just posted this in Beginner and General C++ Programming for better and Faster replies...
//apologizes for doing like this but it's urgent and not my homework...
What do mean by - return from wlcscrn not just playerinfo...I dont want to end the program if the amount is under 5000$... I want to only end program if its above 5000$...
Please provide a worthy solution bro.. You cant speak to Beginners This Way... I didn't really get you...