// july9ex3.cpp : Defines the entry point for the console application.
// This program creates random melodies
//This program creates a melody with exactly three "Do"s in it!

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

int main(int argc, char* argv[])
{    int note;
     int num_dos=0;
     srand(time(NULL));

	 while (num_dos <3) {
         note = rand() % 8 + 1; 

		 switch (note) {

		  case 1: printf("Do1 \n");
			  num_dos++;
			 break;
		  case 2: printf("Re \n");
			 break;

		  case 3: printf("Mi \n");
			 break;
		  case 4: printf("Fa \n");
			 break;
		  case 5: printf("So \n");
			 break;
		  case 6: printf("La \n");
			 break;
		  case 7: printf("Ti \n");
			 break;
		  case 8: printf("Do2 \n");
			   num_dos++;

		 } /* end switch note */

	 } /*end while num_dos */
	
  printf("**********\n");
	return 0;
}