Hello and sorry for interrupting you guys but i need help regarding to my program that i will pass after a couple of days. I am very new to programming , and were obliged to pass a simple program that have a insert,display and delete function but i'm stucked in the insert function because it has many errors .
Here's the program,
#include #include #define gt gotoxy
int i,choice;
void menu();
void display();
void delete();
void insert();
void quit();
main(){
clrscr();
menu();
getche();
}
void menu()
{
clrscr();
gt(25,5);printf("Choose one:")
gt(20,6);printf(" [A] Insert ");
gt(20,7);printf(" [B] Display ");
gt(20,8);printf(" [C] Delete ");
gt(20,9);printf(" [D] Quit ");
choice = toupper(getche());
if (choice=='A')
insert();
else if (choice=='B')
display();
else if (choice =='C')
delete();
else if (choice=='D')
quit();
else
clrscr();
gt(28,20);p("A-D only");
}
void insert(){
char name[15]
int name,amt,interest,ar,p;
int choice,cnf;
clrscr();
gt(26,6);printf("Enter Name:");
scanf("%s",&name);
gt(26,8);printf("Enter Amount:");
scanf("%d", &amt);
gt(26,10);printf("
Choose Mode of Payment:");
gt(26,11);printf("
[1] 1 month");
gt(26,12);printf("
[2] 4 months");
gt(26,13);printf("
[3] 6 months");
gt(26,14);printf("
[4] 12 months");
gt(26,15);printf("
Mode:");
choice=getche();
switch(choice){
case '1':
clrscr();
printf("
name:%s",name);
printf("
Amount Loaned:%d, amt);
interest= amt*0.01;
ar=amt-interest;
p=amt/1;
printf("
Interest: %d" ,interest);
printf("
Amount Received: %d" ,ar);
p("
Payment: %d" ,p);
getch();
main();
break();
case '2':
clrscr();
printf("
name:%s",name);
printf("
Amount Loaned:%d, amt);
interest= amt*0.03;
ar=amt-interest;
p=amt/4;
printf("
Interest: %d" ,interest);
printf("
Amount Received: %d" ,ar);
p("
Payment: %d" ,p);
getch();
main();
break();
case '3':
clrscr();
printf("
name:%s",name);
printf("
Amount Loaned:%d, amt);
interest= amt*0.04;
ar=amt-interest;
p=amt/6;
printf("
Interest: %d" ,interest);
printf("
Amount Received: %d" ,ar);
p("
Payment: %d" ,p);
getch();
main();
break();
case '4':
clrscr();
printf("
name:%s",name);
printf("
Amount Loaned:%d, amt);
interest= amt*0.06;
ar=amt-interest;
p=amt/12;
printf("
Interest: %d" ,interest);
printf("
Amount Received: %d" ,ar);
p("
Payment: %d" ,p);
getch();
main();
break();
}
gt(26,18);printf("return to menu[y/n]?");
{
cnf = toupper(getche());
}
while(cnf!='N' && cnf !='Y');
if (cnf=='N'){
clrscr();
else{
main();
}
getch();
}
I can't proceed to Display and Delete because of these so the codes is incomplete .
it has a declaration missing ; error in void menu and i can't find a way fix it
and also can anyone give me an idea on display and delete functions?
any help will be greatly appreciated! thanks in advance.