Beginner C/C++

Moderators: None (Apply to moderate this forum)
Number of threads: 5430
Number of posts: 16951

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Need Help Here plsss Posted by KSEyuri on 15 Mar 2013 at 8:32 AM
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 <stdio.h>
#include <conio.h>
#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(" 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("\n\tChoose Mode of Payment:");
gt(26,11);printf("\n [1] 1 month");
gt(26,12);printf("\n[2] 4 months");
gt(26,13);printf("\n[3] 6 months");
gt(26,14);printf("\n[4] 12 months");
gt(26,15);printf("\n\tMode:");

choice=getche();
switch(choice){

case '1':

clrscr();
printf("\n\tname:%s",name);
printf("\n\tAmount Loaned:%d, amt);

interest= amt*0.01;
ar=amt-interest;
p=amt/1;

printf("\n\tInterest: %d" ,interest);
printf("\n\tAmount Received: %d" ,ar);
p("\n\tPayment: %d" ,p);
getch();
main();
break();

case '2':

clrscr();
printf("\n\tname:%s",name);
printf("\n\tAmount Loaned:%d, amt);

interest= amt*0.03;
ar=amt-interest;
p=amt/4;

printf("\n\tInterest: %d" ,interest);
printf("\n\tAmount Received: %d" ,ar);
p("\n\tPayment: %d" ,p);
getch();
main();
break();

case '3':

clrscr();
printf("\n\tname:%s",name);
printf("\n\tAmount Loaned:%d, amt);

interest= amt*0.04;
ar=amt-interest;
p=amt/6;

printf("\n\tInterest: %d" ,interest);
printf("\n\tAmount Received: %d" ,ar);
p("\n\tPayment: %d" ,p);
getch();
main();
break();

case '4':

clrscr();
printf("\n\tname:%s",name);
printf("\n\tAmount Loaned:%d, amt);

interest= amt*0.06;
ar=amt-interest;
p=amt/12;

printf("\n\tInterest: %d" ,interest);
printf("\n\tAmount Received: %d" ,ar);
p("\n\tPayment: %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.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.