// july9ex4.cpp : Defines the entry point for the console application.
// This program creates random jelly beans; red, white & blue.  There are double
//the number of red jelly beans.  Each jelly bean costs between 20 and 400 cents
// each.

#include "stdafx.h"
#include "stdlib.h"
#include "time.h"

int main(int argc, char* argv[])
{    int jelly, cost, num;
     srand(time(NULL));

     for (num=1; num<=25; num++) {
        jelly=rand() % 4 + 1;
		cost = rand() % 381 + 20;  /* create rand nums 20 <-> 400 */

        printf("You chose a ");

        switch (jelly) {
		case 1: case 2: printf("red  ");
			break;
		case 3: printf("white");
			break;
		case 4: printf("blue ");

		} /* end switch jelly */

        printf(" which costs %3d cents.\n", cost);

	 } /* end for num */



	return 0;
}