#define MINPRODUCT 0
#define MAXPRODUCT 9999
#define MINTYPE 1
#define MAXTYPE 5
#define MINQUANTITY 1
#define MAXQUANTITY 50
#define MINCOST 5.00
#define MAXCOST 900.00
#define MINPRICE 6.00
#define MAXPRICE 1000.00
int menu();
void add();
void show(int number, int numUnits, double costB, double priceB);
int getint(char prompt1[], int min, int max);
double getreal(char prompt2[], double min2, double max2);
double total(int,double);
#include <stdio.h>
int main(void)
{
int switchchoice;
do
{ /* loop until 0 is selected from menu() */
switchchoice = menu(); /* call menu to get choice */
switch(switchchoice)
{
case 5: /* quit now */
printf("\tYou selected QUIT. Bye.");
continue;
case 1:
add();
break;
case 2:
printf("this function is not yet implemented");
break;
case 3:
printf("\tThis function is not yet implemented.");
break;
case 4:
printf("\tThis function is not yet implemented.");
break;
}
}
while (switchchoice != 5);
return 0;
}
int menu()
{
int menuchoice;
printf("\n\tSporting Goods\n\n"); /* Name of the company */
printf("\t---------------------\n\n");
printf("\t1 = Add a record\n"); /* Menu choices begin with this line */
printf("\t2 = Report\n");
printf("\t3 = Delete a record\n");
printf("\t4 = Change a record\n");
printf("\t5 = Quit\n\n"); /* Menu choices end with this line */
printf("\n\tEnter choice: ");
scanf("%d%*c", &menuchoice); /* prompt for choice and return it to main() */
return (menuchoice);
}