Click here to Skip to main content
15,896,207 members
Home / Discussions / C#
   

C#

 
GeneralRe: OleDbType cast to BaseType .Net Pin
Dave Kreskowiak2-Oct-05 8:50
mveDave Kreskowiak2-Oct-05 8:50 
QuestionHelp!! monitor bandwidth usage Pin
dunbshy2-Oct-05 3:03
dunbshy2-Oct-05 3:03 
AnswerRe: Help!! monitor bandwidth usage Pin
Dave Kreskowiak2-Oct-05 7:09
mveDave Kreskowiak2-Oct-05 7:09 
GeneralRe: Help!! monitor bandwidth usage Pin
dunbshy2-Oct-05 7:26
dunbshy2-Oct-05 7:26 
GeneralRe: Help!! monitor bandwidth usage Pin
Dave Kreskowiak2-Oct-05 8:45
mveDave Kreskowiak2-Oct-05 8:45 
GeneralRe: Help!! monitor bandwidth usage Pin
dunbshy2-Oct-05 22:51
dunbshy2-Oct-05 22:51 
GeneralRe: Help!! monitor bandwidth usage Pin
Dave Kreskowiak6-Oct-05 11:54
mveDave Kreskowiak6-Oct-05 11:54 
QuestionRoulette Help!!! Pin
ArsNeo2-Oct-05 1:48
ArsNeo2-Oct-05 1:48 
Here my program:

#include <io.h>
#include <stdio.h>
#include <math.h>
#include <time.h>

int main()
{
int bets, bets_made, bet_num[50], betmoney[50];
short roulette_choice, spinval;
double num_bets;
int betcheck = -1;
long cash = 500;

short bet = 0;

while ( !bet )
{
menumain: printf ( "\n\n\n *** Roulette ***\n" );
printf ( "(1): Place a bet\n" );
printf ( "(2): Check your cash\n" );
printf ( "(3): Mortage your house\n" );
printf ( "(4): Quit Roulette\n" );
printf ( "(5): Retire\n" );
printf ( "Please enter your choice: ");
scanf ( "%d", &roulette_choice );
switch (roulette_choice)
{
case 1: printf ( "\n\n\nHow many bets will you place?" );
scanf ( "%d", &num_bets );
num_bets = num_bets - 1;
bets_made = -1;

while (bets_made < num_bets)
{
bets_made++;
beginning:
printf ( "\nWhat number will you place a bet on (0-36)? " );
scanf ( "%d", &bet_num[bets_made] );

if ( 36 < bet_num[bets_made] || 0 > bet_num[bets_made] )
{
goto beginning;
}

printf ( "How much will you bet on number", "%d", &bet_num[bets_made], "?" );
scanf ( "%d", &betmoney[bets_made] );
}
bet= 1;
break;

case 2: printf ( "\n\nYou have $", "%d", &cash, "at this time." );
break;

case 3: printf ( "\n\nI think you need to go cool it for a while." );
return 0;

case 4: printf ( "\n\nReturning to the main menu now." );
return 0;

case 5: return 0;

default: printf ( "\n\nStay away from the bar for a while would ya?" );
goto menumain;

}
}
spinval = rand () %37;
printf ( "\n\n\nThe winning number is ", "%d", &spinval, "!" );

while (betcheck < num_bets )
{
betcheck ++;
if ( bet_num[betcheck] - spinval == 0 )
{
printf ( "\n\n\nYou won with the number ", "%d", &bet_num[betcheck], "!" );
cash = cash + (betmoney[betcheck] * (37.00/num_bets));
bet = betmoney[betcheck] * (37.00/(num_bets + 1));
printf ( "\nYou made $ ");
scanf ( "%d", &bet);
goto main;
}
}

printf ( "\n\nSorry pal, better luck next time\n" );
goto main;
}

Please tell me where is do mistake. Thank you.
AnswerRe: Roulette Help!!! Pin
Dave Kreskowiak2-Oct-05 2:21
mveDave Kreskowiak2-Oct-05 2:21 
GeneralRe: Roulette Help!!! Pin
ArsNeo2-Oct-05 6:47
ArsNeo2-Oct-05 6:47 
GeneralRe: Roulette Help!!! Pin
Dave Kreskowiak2-Oct-05 7:04
mveDave Kreskowiak2-Oct-05 7:04 
GeneralRe: Roulette Help!!! Pin
ArsNeo3-Oct-05 11:55
ArsNeo3-Oct-05 11:55 
GeneralRe: Roulette Help!!! Pin
Dave Kreskowiak6-Oct-05 11:47
mveDave Kreskowiak6-Oct-05 11:47 
AnswerRe: Roulette Help!!! Pin
Christian Graus2-Oct-05 3:04
protectorChristian Graus2-Oct-05 3:04 
QuestionEncapsulation Pin
Tran Ngoc Minh2-Oct-05 0:23
Tran Ngoc Minh2-Oct-05 0:23 
AnswerRe: Encapsulation Pin
Christian Graus2-Oct-05 3:02
protectorChristian Graus2-Oct-05 3:02 
QuestionCoding Problem Pin
| Muhammad Waqas Butt |1-Oct-05 23:45
professional| Muhammad Waqas Butt |1-Oct-05 23:45 
QuestionRoulette Urgent Help!! Pin
ArsNeo1-Oct-05 22:52
ArsNeo1-Oct-05 22:52 
AnswerRe: Roulette Urgent Help!! Pin
mav.northwind1-Oct-05 23:56
mav.northwind1-Oct-05 23:56 
GeneralRe: Roulette Urgent Help!! Pin
leppie2-Oct-05 3:15
leppie2-Oct-05 3:15 
Questiondelegate in remoting Pin
Web cam1-Oct-05 22:44
Web cam1-Oct-05 22:44 
QuestionTree Creation Code Pin
Baatezu1-Oct-05 20:56
Baatezu1-Oct-05 20:56 
QuestionEmbed a web link inside a messageBox() Pin
raysot7771-Oct-05 18:30
raysot7771-Oct-05 18:30 
AnswerRe: Embed a web link inside a messageBox() Pin
David Stone1-Oct-05 19:37
sitebuilderDavid Stone1-Oct-05 19:37 
AnswerRe: Embed a web link inside a messageBox() Pin
Mahesh Kumar V K2-Oct-05 21:51
Mahesh Kumar V K2-Oct-05 21:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.