<mosaic.cnfolio.com>
PROGRAM
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. #include <string.h>
  5.  
  6. /*
  7. START
  8. Set number of bets
  9. Set profits
  10. set losser
  11. set total loss
  12. set payout
  13. set calculation
  14. While there is a bet avaible less then 4 bets and numbers
  15. Get the Number
  16.    Get the Value
  17.    Bet number is between ZERO and 36 AND
  18.     Bet Value is a positive numbers
  19.    if bet 0
  20.    Display Error
  21.    THEN
  22.     Spin the ball and wheel using American Wheel and Table with 00
  23.       Display the winning number
  24.       Display Winners
  25.       Display Losser
  26.       Display Total Profit
  27.       Dislay Total Loss
  28.       Display Payout
  29. End
  30. */
  31.      
  32. int main ()
  33. {
  34. // value declarations //
  35. char Gambler1n[2], Gambler2n[2], Gambler3n[2], Gambler4n[2];
  36. int GB1, GB2, GB3, GB4;
  37. int loss1, loss2, loss3, loss4;
  38. int payout;
  39. int total;
  40. int loss;
  41. int totalprofit;
  42. int pro;
  43. printf("WELCOME CASINO \n" );                                        // display WELCOME //
  44.  
  45. printf("Enter Gambler1 Number \n");                                    // display gambler one's number //
  46.      
  47.        printf("Enter GB1 bet \n");                                        // display gambler one's bet //
  48.         scanf("%s %d", &Gambler1n,&GB1);                                // read the bet and amount bet on //
  49.        
  50.          
  51.                
  52.                
  53.             printf("Gambler1 %s GB1 %d \n",Gambler1n,GB1);        // display gambler one bet and money //
  54.  
  55. total=GB1;           
  56.            
  57.            
  58.                
  59. printf("Enter Gambler2 Number \n");                                    // display gambler two's number //
  60.      printf("Enter GB2 bet \n");                                        // display gambler two's bet //
  61.         scanf("%s %d", &Gambler2n,&GB2);                                // read the bet and amount bet on //
  62.        
  63.                
  64.             printf("Gambler2 %s GB2 %d \n",Gambler2n,GB2);        // display gambler two bet and money //
  65.            
  66. total=GB2;
  67.  
  68.  
  69. printf("Enter Gambler3 Number \n");                                    // display gambler three's number //
  70.     printf("Enter GB3 bet \n");                                        // display gambler three's bet //
  71.         scanf("%s %d", &Gambler3n,&GB3);                                // read the bet and amount bet on //
  72.        
  73.             printf("Gambler3 %s GB3 %d \n",Gambler3n,GB3);        // display gambler three bet and money //
  74.            
  75. total=GB3;
  76. printf("Enter Gambler4 Number \n");                                    // display gambler four's bet //
  77.     printf("Enter GB4 bet \n");                                        // display gambler four's bet //
  78.           scanf("%s %d", &Gambler4n,&GB4);                            //    read the bet and amount bet on //
  79.          
  80.              printf("Gambler4 %s GB4 %d \n",Gambler4n,GB4);     // display gambler four bet and money //
  81.  
  82. total=GB4;
  83. if((GB1<=0)||(GB2<=0)||(GB3<=0)||(GB4<=0)){
  84. printf("Please Enter Correct Value\n");
  85. return 0;}
  86. total=GB1 + GB2 + GB3 + GB4;
  87. printf("Total Betting = %dŁ\n",total);
  88.  
  89.  
  90.  
  91.  
  92.  
  93. char * random[] = {"0","00","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36"};
  94.     time_t t;
  95.         srand((unsigned) time(&t));
  96.             int rn = rand() % 37;
  97.                 char * randvalue = random[rn];
  98.  
  99.         printf("The Winning Number Is: %s \n", randvalue);                // display the winnig number //
  100. {
  101.  
  102. if(strcmp(Gambler1n,randvalue)==0)                          //string comparion between gambler 1 and random value if they equal to each other//
  103.  
  104. {
  105. printf("Gambler 1 HAS WON \n");                                        // Display Gambler One Has Won //
  106. payout = ( GB1 * 35 );                                                    // Calculation of how much Gambler One earn //
  107. printf("Payout: %dŁ \n",payout);                                        // Display the earning money //
  108. }
  109.  
  110.     else if(strcmp(Gambler1n,randvalue)!=0);          
  111.     {
  112.  
  113.          printf("Gambler 1 HAS LOST \n");                            // Display Gambler One Has Lost //
  114.          loss1 = -1 * GB1;
  115.          printf("Cash Loss = %dŁ\n",loss1);
  116.          }
  117.          
  118. if(strcmp(Gambler2n,randvalue)==0)                        //string comparion between gambler 2 and random value if they equal to each other//
  119.  
  120. {
  121. printf("Gambler 2 HAS WON \n");                                        // Display Gambler Two Has Won //
  122. payout = ( GB2 * 35 );                                                    // Calculation of how much Gambler Two earn //
  123. printf("Payout: %dŁ \n",payout);                                        // Display the earning money //
  124. }
  125.         else if(strcmp(Gambler2n,randvalue)!=0)        
  126.         {
  127.  
  128.           printf("Gambler 2 HAS LOST \n");                            // Display Gambler Two Has Lost //
  129.          loss2 = -1 * GB2;                                           //Calculation of how much Gambler two lost//
  130.          printf("Cash Loss = %dŁ\n",loss2);
  131.  
  132.  }
  133.  
  134. if(strcmp(Gambler3n,randvalue)==0)                    //string comparion between gambler 3 and random value if they equal to each other//
  135.  
  136. {
  137. printf("Gambler 3 HAS WON \n");                                        // Display Gambler Three Has Won //
  138. payout = ( GB3 * 35 );                                                    // Calculation of how much Gambler Three earn //
  139. printf("Payout: %dŁ \n",payout);                                            // Display the earning money //
  140. }
  141.         else if(strcmp(Gambler3n,randvalue)!=0)
  142.       {
  143.  
  144.           printf("Gambler 3 HAS LOST \n");                            // Display Gambler Two Has Lost //
  145.          loss3 = -1 * GB3;               //Calculation of loss//
  146.          printf("Cash Loss = %dŁ\n",loss3);                    //display the cash loss//
  147.       }
  148.  
  149. if(strcmp(Gambler4n,randvalue)==0)                          //string comparion between gambler 4 and random value if they equal to each other//
  150.  
  151. {
  152. printf("Gambler 4 HAS WON\n");                                        // Display Gambler Three Has Won //
  153. payout = ( GB4 * 35 );                                                    // Calculation of how much Gambler Three earn //
  154. printf("Payout: %dŁ \n",payout);                                            // Display the earning money //
  155. }
  156.         else if (strcmp(Gambler4n,randvalue)!=0)
  157.         {
  158.  
  159.           printf("Gambler 4 HAS LOST\n");                            // Display Gambler Two Has Lost //
  160.          loss4 = -1 * GB4;                //Calculation of loss//
  161.          printf("Cash Loss = %dŁ\n",loss4);                     //display the cash loss//
  162.          }
  163. loss= loss1 + loss2 + loss3 + loss4;                                 //CALCULATION the loss money//
  164. printf("Total Lossing Money = %dŁ\n",loss);                //display how much loss//
  165.  
  166. totalprofit= GB1 * 35 + GB2 * 35 + GB3 * 35 + GB4 * 35;        //calculation of the total profit//
  167. printf("Total Profit Money = %dŁ\n",totalprofit);
  168.  
  169.  
  170.  
  171.  
  172. }
  173. }