Almost There
Posted by Flamez53
Last Updated: March 12, 2013
  2339

You guys have been so cool to help me with my code and i want to say thanks anyway this is the last code however i'm getting 95 errors please can see whats wrong with this one.



#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<stdlib.h>
#include<time.h>

void create();
void New Member(FILE *Fimi);
void Existing member(FILE *Fimi);
void Exit program(void);
void Welcome Screen(void);
void Main Menu(void);
int  Get Password();
void Delete Member(FILE *Fimi);


typedef struct
{
int Member;
int MemNum;
char L_Name[15];
char F_Name[15];
char Address[30];
int Telephone_Number;
char Spouse_Lname[15];
char Spouse_Fname[15];
int Spouse_TelephoneNumber ;
char Spouse_Address[30];
char Plan[10];
int Amt_Paid;
int Balance;
}New Member;

FILE *Fimi;

void main()

{
int Password Correct;

printf("%s\n",__DATE__);
printf("%s\n",__TIME__);

Welcome Screen();
if(Password Correct == 0)

system("cls");
Main Menu();


void Welcome Screen( ) {

system("cls");
printf("%s\n",__TIME__);
printf("%s",__DATE__);

printf("\n********************************");
printf("\n  WELCOME TO THE ST ANN \n");
printf("\n  PARISH        COUNCIL \n");
printf("\n  DATABASE      MANAGEMENT\n");
printf("\n\        SYSTEM           \n");
printf("\n\*******************************\n");
GetPassword();
}

int Get Password()

int count;
char Password[20];

for(count=3;count!=-1;count--){
printf("\n\t\t\t\tEnter Password:-  ");
scanf("%s",&Password);

if(strcmp(Password,"cybertech")==0){
system("cls");
Main Menu()

}else{
printf("\n Wrong Password \n");
printf("\n\You have %d more times to enter password\n",count);

system("cls");
}


printf("\n\t\t\tYou have no more tries!\n\n");
getch();
exit(0);

void Main Menu()
{
int ;


printf("\n* MAIN MENU *\n");
printf("\n*******************************************\n");
printf("\nSelect one of the following option:\n");
printf("\nPress C to Create New Member.\n");
printf("\nPress V to View Existing Member.\n");
printf("\nPress D to Delete Member File.\n");
printf("\nPress L to Log off.\n");
printf("\nPress E to Exit program.\n");
printf("\n#################################################\n");

printf("\Option:");
scanf("%d",&choice);


switch(choice){
case 1: New Member(Fimi);
break;

case 2: Existing Member(Fimi);
break;

case 3: Delete Member(Fimi);
break;

case 4:   Welcome Screen();
break;

case 5:Exit (0);
break;

default:
break;
}
}

void New Member(FILE *Fimi)
{
New Member ;
int Member;


if((Fimi=fopen("Database.txt","r+"))==NULL)
printf("File Could not be open\n");

else
system("cls");

printf("\n*****************************************************\n");
printf("\n ST ANN PARISH COUNCIL DATABASE MANAGEMENT SYSTEM\n");
printf("\n****************************************************\n");


printf("\n Please Enter Last name: ");
scanf("%s",&L_Name);

printf("\n Please Enter First name: ");
scanf("%s",&F_Name);

printf("\n Please Enter Address: ");
scanf("%s",&Address);

printf("\n Please Enter Telephone Number: ");
scanf("%d",&Telephone_Number);

printf("\n Spouse Information\n");

printf("\n Please Enter Spouse Last name: ");
scanf("%s",&Spouse_LName);

printf("\n Please Enter First name: ");
scanf("%s",&Spouse_FName);

printf("\n Please Enter Spouse Address: ");
scanf("%s",&Spouse_Address);

printf("\n Please Enter Spouse Telephone Number: ");
scanf("%d",&Spouse_TelephoneNumber);

printf("\n Please Enter Plan: ");
scanf("%s",&Plan);

printf("\n Please Enter Amount Paid: ");
scanf("%d",&AmtPaid);

printf("\n Please Enter Balance: ");
scanf("%d",&Balance);

Member = Member;
fseek(Fimi, (Member -1)* sizeof(New Member),SEEK_SET);
fwrite(&, sizeof(New Member), 1, Fimi);

printf("\n ********************************************************\n");
printf("\t THANK YOU FOR USING THE ST ANN PARISH COUNCIL DATABASE MANAGEMENT SYSTEM");
printf("\n ********************************************************\n");

getch();
system("cls");
mainmenu();
}
}

void Existing Member(FILE *Fimi)
{
int Member;
int Telephone_Number;
int Amt_Paid;
int Balance;
char address[30];
char Plan[10];
New Member;

if((Fimi=fopen("Database.txt","r+"))==NULL){
printf("File Could not be open\n");
}
else {
system("cls");

printf("Enter Member Number : ");
scanf("%d", &MemNum);

fseek(Fimi,(MemNum - 1)* sizeof(New Member),SEEK_SET);
fread(sizeof(New Member), 1, Fimi);

if (Member == 0){

printf("Member #%d has no information\n",MemNum);
printf("\n**********************************************************************\n");
printf("\tTHANK YOU FOR USING ST ANN PARISH COUNCIL DATABASE MANAGEMENT SYSTEM");
printf("\n**********************************************************************\n");
getch();
system("cls");
mainmenu();}
else
{
printf("\n%5s%20s%23s%25s","Member#","First Name","Last Name","Telephone#");
printf(" \n\n");
printf("%5d%20s%25s%25d\n\n",Member,F_Name,L_Name,Telephone_Number);

printf("\n%5s%20s%23s%25s","Address","Plan","Amount Paid","Balance");
printf(" \n\n");
printf("%5s%20s%25d%25d\n\n",Address,Plan,Amt_Paid,Balance);

printf("\n\nTo Edit Press 1 or press any key to return to Main Menu: ");
scanf("%d",&t);

if ( t ==1){

printf("Enter Address: \n");
scanf("%s",Address);
for (i=0;i<=20;i++)
Address = Address;
printf("Enter Telephone_Number: \n");
scanf("%d",&Telephone_Number);
Telephone_Number = Telephone_Number;

printf("Enter Plan: \n");
scanf("%s",Plan);
for (l=0;l<=20;l++)
Plan = Plan;

printf("Enter Amount Paid: \n");
scanf("%d",&Amt_Paid);
Amt_Paid = Amt_Paid;

printf("Enter Balance: \n");
scanf("%d",&Balance);
Balance = Balance;
printf("\n%5s%20s%23s%25s","Member#","First Name","Last Name","Telephone#");
printf(" \n\n");
printf("%5d%20s%25s%25d\n\n",Member,F_Name,L_Name,Telephone_Number/*,Amt_Paid,Balance*/);

printf("\n%5s%23s%23s%25s","Address","Plan","Amount Paid","Balance");
printf(" \n\n");
printf("%5s%20s%25d%25d\n\n",Address,Plan,Amt_Paid,Balance);

fseek(russian,(MemNum - 1)* sizeof(New Member),SEEK_SET);
fwrite(sizeof(New Member), 1, Fimi);

getch();
system("cls");
mainmenu();

}else{

printf("\n******************************************************\n");
printf ("\t THANK YOU FOR USING ST ANN PARISH COUNCIL DATABASE MANAGEMENT ");
printf("\n******************************************************\n");
getch();
system("cls");
mainmenu();
}
}
}
}


void deletemember(FILE *Fimi)
{
New Member blank = {0,"","","",0,"","",0,"","",0,0.0};
int MemNum;
int yes;


if((Fimi=fopen("Database.txt","r+"))==NULL)
printf("File Could not be open\n");

else
system("cls");

printf("Enter Member Number to delete: ");
scanf("%d",&MemNum );

fseek(Fimi,(MemNum - 1)* sizeof(New Member),SEEK_SET);
fread(sizeof(New Member), 1, Fimi);

if (Member == 0)
{
printf(" Member # %d does not exist",memnum);
printf("\n**********************************************************\n");
printf("\tTHANK YOU FOR USING ST ANN PARISH COUNCIL DATABASE MANAGEMENT SYSTEM");
printf("\n***********************************************************\n");

getch();
system("cls");
mainmenu();

}
else
{
printf("\n%5s%20s%23s%25s","Member#","First Name","Last Name","Telephone#");
printf(" \n\n");
printf("%5d%20s%25s%25d\n\n",Member,F_Name,L_Name,Telephone_Number/*,gill.amt_paid,gill.balance*/);

printf("\n%5s%20s%23s%25s","Address","Plan","Amount Paid","Balance");
printf(" \n\n");
printf("%5s%20s%25d%25d\n\n",Address,Plan,Amt_Paid,Balance);

printf("\n  Are you sure ?..\n\n   For yes Press 1 :-:\n\n   For no press 2 :-:\n");
scanf("%d",&yes);

if (yes == 1){

fseek(Fimi,(MemNum - 1)* sizeof(New Member),SEEK_SET);
fwrite(&blank, sizeof(New Member), 1, Fimi);

printf("\n\n\t\t     Files have been successfully deleted\n\n");
printf("\n\n\n\****************************************************************\n");
printf("\t    THANK YOU FOR USING ST ANN PARISH COUNCIL DATABASE MANAGEMENT SYSTEM");
printf("\n\n\n***************************************************************** \n");

getch();
system("cls");
mainmenu();
}
else
{
printf("\n\n\n\******************************************************************\n");
printf("\t    THANK YOU FOR USING ST ANN PARISH COUNCIL DATABASE MANAGEMENT SYSTEM");
printf("\n\n\n******************************************************************\n");

getch();
system("cls");
mainmenu();
}
}
}
   
  
 
 
   

 
 
I took the code and examined it and i saw that the code isn't logically or syntactically correct. it you look at the prototype for example, u will see the evidence of incorrect function definition. So here is my advice, if u are editing the code that janwan posted, try changing it by adhering to the syntax rules and as you change it debug to see if it contains any error, it minimize the amount of errors that u will get at the end. Its great to see that u are gallantly fighting the Com Sci SBA battle. thumbs up! When u finish editing the code post it below or if time is running out let me know so that i can speed up the process.


 
This is just ridiculous, the code is all over the place, syntax errors, incorrect function definitions, all i can say is wow just wow -___-