>you never used scanf anywhere... ???
This is a good thing, scanf should be avoided.
>I tried to input information about the customer name address and coupon but it won't compile.
Start by inputting the name successfully, then move on to the other items. If you find your program doesn't work then break it up into several smaller programs to try and find out why. Nothing is more informative than writing a test program for something you don't understand. This code will start you off and compiles just fine:
Code:
#include <stdio.h>
#include <stdlib.h>
#define MAX_NAME 30
#define TITLE "Mabuhay Video Store"
void getcustomer(char *name);
int main(void)
{
char name[MAX_NAME + 1];
int choice;
do
{
system ("cls");
printf("=============================\n");
printf(" %s\n", TITLE);
printf("=============================\n\n");
printf("1 Enter Customer Information\n");
printf("2 Enter Rental Information\n");
printf("3 Compute Charges\n");
printf("4 Dispaly Receipt\n");
printf("5 Exit Program\n\n");
printf(" Selection: ");
scanf("%d",&choice);
getchar();
if(choice==1)
{
getcustomer(name);
}
else if(choice==2)
{
/* Placeholder */
}
else if(choice==3)
{
/* Placeholder */
}
else if(choice==4)
{
/* Placeholder */
}
else
{
break;
}
}while(choice!=5);
return EXIT_SUCCESS;
}
void getcustomer(char *name)
{
system("cls");
printf("Store Name:\n\n");
printf("Customer Name: ");
/*
** fgets reads one line of input, stopping at either
** the second argument, or when the return key is pressed.
*/
fgets(name, MAX_NAME + 1, stdin);
}
Note that this code can be problematic, but those situations are safe to ignore at this point in your learning. I know that this isn't quite the answer you wanted, but sometimes working through a problem simply by studying your code and reading books until your eyes bleed is the best way to learn. Just keep at it and if you get really stuck somewhere, either come to us or your instructor. The thing to remember is that you are continually learning with every bit of this you work on, especially if it doesn't work.
-Prelude