<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. START
  3.    INPUT
  4.    all bets as integer
  5.    total bet amounts as float
  6.    
  7.   IF STATEMENT betOne
  8.    print 00 if input equal to 38
  9.    ELSE
  10.    print stored input for betOne
  11.    END IF
  12.    
  13.    IF STATEMENT winningOne
  14.    print 00 if input equal to 38
  15.    ELSE 
  16.    print stored inout for betOne
  17.    END IF
  18.    
  19.    IF STATEMENT betOne equal to winningOne
  20.    betOneAmount x payout equals payoutOne
  21.    payoutTotal x payoutOne equals payoutTotal
  22.    print winner, total payments for first bet
  23.    ELSE
  24.    payoutOne equals betOneAmount
  25.    payoutTotal - payoutOne equals payoutTotal
  26.    print total loss
  27.    print total subtotal loss
  28.    END IF
  29.    
  30.    IF STATEMENT betTwo
  31.    print 00 if input equal to 38
  32.    ELSE
  33.    print stored input for betTwo
  34.    END IF
  35.    
  36.    IF STATEMENT winningTwo
  37.    print 00 if input equal to 38
  38.    ELSE 
  39.    print stored inout for betTwo
  40.    END IF
  41.    
  42.    IF STATEMENT betTwo equal to winningTwo
  43.    betTwoAmount x payout equals payoutTwo
  44.    payoutTotal x payoutTwo equals payoutTotal
  45.    print winner, total payments for second bet
  46.    ELSE
  47.    payoutTwo equals betTwoAmount
  48.    payoutTotal - payoutTwo equals payoutTotal
  49.    print total loss
  50.    print total subtotal loss
  51.    END IF
  52.    
  53.    IF STATEMENT betThree
  54.    print 00 if input equal to 38
  55.    ELSE
  56.    print stored input for betThree
  57.    END IF
  58.    
  59.    IF STATEMENT winningThree
  60.    print 00 if input equal to 38
  61.    ELSE 
  62.    print stored inout for betThree
  63.    END IF
  64.    
  65.    IF STATEMENT betThree equal to winningThree
  66.    betThreeAmount x payout equals payoutThree
  67.    payoutTotal x payoutThree equals payoutTotal
  68.    print winner, total payments for third bet
  69.    ELSE
  70.    payoutThree equals betThreeAmount
  71.    payoutTotal - payoutThree equals payoutTotal
  72.    print total loss
  73.    print total subtotal loss
  74.    END IF
  75.    
  76.    IF STATEMENT betFour
  77.    print 00 if input equal to 38
  78.    ELSE
  79.    print stored input for betFour
  80.    END IF
  81.    
  82.    IF STATEMENT winningFour
  83.    print 00 if input equal to 38
  84.    ELSE 
  85.    print stored inout for betFour
  86.    END IF
  87.    
  88.    IF STATEMENT betFour equal to winningFour
  89.    betFourAmount x payout equals payoutFour
  90.    payoutTotal x payoutFour equals payoutTotal
  91.    print winner, total payments for fourth bet
  92.    ELSE
  93.    payoutFour equals betFourAmount
  94.    payoutTotal - payoutOne equals payoutTotal
  95.    print total loss
  96.    print total subtotal loss
  97.    END IF
  98.      
  99. End
  100. */
  101. #include <stdio.h>
  102. #include <stdlib.h>
  103. #include <time.h>
  104.  
  105. int main (void)
  106. {
  107.   /*user inputs variables */
  108.   int betOne;
  109.   float betOneAmount;
  110.   int betTwo;
  111.   float betTwoAmount;
  112.   int betThree;
  113.   float betThreeAmount;
  114.   int betFour;
  115.   float betFourAmount;
  116.  
  117.   float payoutOne = 0;
  118.   float payoutTwo = 0;
  119.   float payoutThree = 0;
  120.   float payoutFour = 0;
  121.   float payoutTotal = 0;
  122.    
  123.   int payout = 35;
  124.  
  125.   /*variables for srand function*/
  126.   int winningOne=0;
  127.   int winningTwo=0;
  128.   int winningThree=0;
  129.   int winningFour=0;
  130.  
  131.   /*Reads inputs*/
  132.   scanf("%d %f %d %f %d %f %d %f", &betOne, &betOneAmount, &betTwo, &betTwoAmount, &betThree, &betThreeAmount, &betFour, &betFourAmount);
  133.  
  134.   /*srand function generates random number for winning bets*/
  135.   srand(time(0));
  136.   winningOne = rand()%38;
  137.   winningTwo = rand()%38;
  138.   winningThree = rand()%38;
  139.   winningFour = rand()%38;
  140.  
  141.   if (betOne == 38)
  142.   {
  143.     printf("Your First bet is 00 \n");
  144.   }
  145.   else
  146.   {
  147.     printf("Your First bet is %d \n", betOne);
  148.   }
  149.  
  150.   /* if statement for 00 */
  151.   if (winningOne == 38)
  152.   {
  153.   printf("The First winning number is %d \n");
  154.   }
  155.   else
  156.   {
  157.   printf("The First winning number is %d \n", winningOne);
  158.   }
  159.  
  160.   /*if statement for total profit/loss for bet 1*/
  161.   if (betOne == winningOne)
  162.   {
  163.   payoutOne=(betOneAmount*payout);
  164.   payoutTotal=(payoutTotal*payoutOne);
  165.   printf("Winner, Total payment for your First bet is %.2f \n", payoutOne);
  166.   printf("Overall subtotal is %.2f \n \n", payoutTotal);
  167.   }
  168.   else
  169.   {
  170.   payoutOne=(betOneAmount);
  171.   payoutTotal=(payoutTotal-payoutOne);
  172.   printf("You have a loss of -%.2f \n", payoutOne);
  173.   printf("Your subtotal is %.2f \n \n", payoutTotal);
  174.   }
  175.  
  176.   if (betTwo == 38)
  177.   {
  178.     printf("Your Second bet is 00 \n");
  179.   }
  180.   else
  181.   {
  182.     printf("Your Second bet is %d \n", betTwo);
  183.   }
  184.  
  185.   if (winningTwo == 38)
  186.   {
  187.   printf("The Second winning number is %d \n");
  188.   }
  189.   else
  190.   {
  191.   printf("The Second winning number is %d \n", winningTwo);
  192.   }
  193.  
  194.   /*if statement for total profit/loss for bet 2*/
  195.    if (betTwo == winningTwo)
  196.   {
  197.   payoutTwo=(betTwoAmount*payout);
  198.   payoutTotal=(payoutTotal*payoutTwo);
  199.   printf("Winner, Total payment for your Second bet is %.2f \n", payoutTwo);
  200.   printf("Overall subtotal is %.2f \n \n", payoutTotal);
  201.   }
  202.   else
  203.   {
  204.   payoutTwo=(betTwoAmount);
  205.   payoutTotal=(payoutTotal-payoutTwo);
  206.   printf("You have a loss of -%.2f \n", payoutTwo);
  207.   printf("Your subtotal is %.2f \n \n", payoutTotal);
  208.   }
  209.    
  210. if (betThree == 38)
  211.   {
  212.     printf("Your Third bet is 00 \n");
  213.   }
  214.   else
  215.   {
  216.     printf("Your Third bet is %d \n", betThree);
  217.   }
  218.  
  219.   if (winningThree == 38)
  220.   {
  221.   printf("The Third winning number is %d \n");
  222.   }
  223.   else
  224.   {
  225.   printf("The Third winning number is %d \n", winningThree);
  226.   }
  227.  
  228.   /*if statement for total profit/loss for bet 3*/
  229.   if (betThree == winningThree)
  230.   {
  231.   payoutThree=(betThreeAmount*payout);
  232.   payoutTotal=(payoutTotal*payoutThree);
  233.   printf("Winner, Total payment for your Third bet is %.2f \n", payoutThree);
  234.   printf("Overall subtotal is %.2f \n \n", payoutTotal);
  235.   }
  236.   else
  237.   {
  238.   payoutThree=(betThreeAmount);
  239.   payoutTotal=(payoutTotal-payoutThree);
  240.   printf("You have a loss of -%.2f \n", payoutThree);
  241.   printf("Your subtotal is %.2f \n \n", payoutTotal);
  242.   }
  243.  
  244.    if (betFour == 38)
  245.   {
  246.     printf("Your Fourth bet is 00 \n");
  247.   }
  248.   else
  249.   {
  250.     printf("Your Fourth bet is %d \n", betFour);
  251.   }
  252.  
  253.   if (winningFour == 38)
  254.   {
  255.   printf("The Fourth winning number is %d \n");
  256.   }
  257.   else
  258.   {
  259.   printf("The Fourth winning number is %d \n", winningFour);
  260.   }
  261.  
  262.   /*if statement for total profit/loss for bet 4*/
  263.   if (betFour == winningFour)
  264.   {
  265.   payoutFour=(betFourAmount*payout);
  266.   payoutTotal=(payoutTotal*payoutFour);
  267.   printf("Winner, Total payment for your Fourth bet is %.2f \n", payoutFour);
  268.   printf("Overall subtotal is %.2f \n \n", payoutTotal);
  269.   }
  270.   else
  271.   {
  272.   payoutFour=(betFourAmount);
  273.   payoutTotal=(payoutTotal-payoutFour);
  274.   printf("You have a loss of -%.2f \n", payoutFour);
  275.   printf("Your subtotal is %.2f \n \n", payoutTotal);
  276.   }
  277. }