- #include<stdio.h>
-
#include<conio.h>
-
#include<string.h>
-
-
main(){
-
typedef struct info {
-
char fname(void),mname(void),famname(void);
-
int age,cont;
-
char adr;
-
} info;
-
void add(void),del(void);
-
char select;
-
-
/************* *************/
-
/***************SCREEN LAYOUT*****************/
-
/************* *************/
-
clrscr();
-
system("cls");
-
-
printf(" ***** Amount Matrix ***** \n\n");
-
printf(" Amount to borrow Monthly Quarterly Semi-Annual Annual \n");
-
printf(" Interest Interest Interest Interest \n\n");
-
printf(" P1,000 below 5% -- -- -- \n");
-
printf(" P1,001 - P10,000 5% 16% -- -- \n");
-
printf(" P10,001 - P50,000 5% 16% 19% -- \n");
-
printf(" P50,001 - P100,000 6% 17% 19% 27% \n");
-
printf(" P100,001 - P500,000 6% 17% 20% 29% \n");
-
printf(" P500,001 - P1,000,000 7% 18% 21% 30% \n");
-
-
-
printf("\n\n\t\t\t\n");
-
printf("\t\t\tMENU \n");
-
printf("\t\t\t [1] Add Entry \n");
-
printf("\t\t\t [2] Delete Record \n");
-
printf("\t\t\t [3] Display List \n");
-
printf("\t\t\t [4] Search \n");
-
printf("\t\t\t [5] Save File \n");
-
printf("\t\t\t [6] Load File \n");
-
printf("\t\t\t [7] Quit \n");
-
printf("\t\t\t\n");
-
printf("\t\t\t\t Selection: \n\n");
-
-
-
-
switch(select)
-
{
-
case '1': add();
-
case '2': del();
-
case '3': disp();
-
case '4': ser();
-
case '5': sav();
-
case '6': lod();
-
case '7': qit();
-
case 23: clrscr();
-
printf("Thank you!");
-
getch();
-
exit(0);
-
-
default: printf("(x)INVALID selection!");
-
getch();
-
exit(0);
-
-
}
-
{
-
-
void add(void){
-
int slot;
-
slot= find_free();
-
if(slot== -1){
-
printf("LIST FULL!");
-
return;
-
}
-
struct{
-
-
printf("Enter first name: ");
-
gets(inv_info[slot].fname);
-
printf("Enter family name: ");
-
scanf("%s", famname);
-
printf("Age: ");
-
scanf("%d%d",&init_info[slot].age);
-
printf("Address[street|city|province|zip]: ");
-
scanf("%d%d*c",&init_info[slot].adr);
-
printf("Contact number[tel/cel]: ");
-
scanf("%d",%con);
-
{}
-
-
}
-
-
/************* *************/
-
/*************DELETE AN ENTRY**********/
-
void del(void)
-
{
-
register int slot;
-
char s[100];
-
printf("Enter Costumer's (family)name: ");
-
gets(s);
-
slot= atoi(s);
-
if(slot>=0 && slot < MAX) info[slot].fname[0]= '\0';
-
}
-
-
/************* *************/
-
/*************DISPLAY LIST**********/
-
void disp(void)
-
{
-
register int t;
-
-
for(t=0; t<MAX; ++t) {
-
it(inv_info[t].name[0]) {
-
printf("Name: %s,%s,%s\n", info[t].fname,info[t].mname,info[t].famname);
-
printf("Age:%s\n", info[t].age);
-
printf("Address:%s\n",info[t].adr);
-
printf("Contact number:%d",info[t].con);
-
}
-
}
-
printf("\n\n");
-
}
-
-
}
-
-
/*******************************************************************/
-
/* function search */
-
/*******************************************************************/
-
ser()
-
-
{
-
-
int i;
-
char name[30];
-
-
clrscr();
-
inputs("\n\n\t\t Enter name to find: ", famname, 30);
-
if((i=find(name))<0)
-
printf("\n\n\t\t Name not found.");
-
else{
-
printf("t%s","-------------------------------------------------\n");
-
-
printf("%10%10%10%10%10\n\n","famname","fname","age","adr","con");
-
display(i);
-
}
-
getch();
-
clrscr();
-
}
-
-
-
-
/*******************************************************************/
-
/* function save */
-
/*******************************************************************/
-
-
sav(){
-
-
{
-
FILE *fp;
-
if((fp=fopen("mlist",:wb))==NULL){
-
printf("\n\n\t\t Cannot open file...\n");
-
return;
-
}
-
printf("\n\t\t Saving File...\n\n\n");
-
fclose(fp);
-
}
-
}
-
-
lod()
-
{}/*********************************************************************/
-
/* function load */
-
/*********************************************************************/
-
lod()
-
{
-
FILE *fp;
-
if((fp=fopen("mlist",:rb))==NULL){
-
printf("\t\tCannot open file...\n");
-
return;
-
}
-
printf("\n\t\tLOading Complete...\n\n");
-
fread(list, sizeoflist, 1, fp);
-
if(ferror(fp))
-
printf("An error occured while reading file!\n");
-
fclose(fp);
-
}
-
qit()
-
{ return 0;
-
}
-
}
-
}
-
hello. everyone! i was just kind'a having trouble with my codes,
could you please check them? hmm.. its not yet finished.. im still gonna add, the range amounts(i'll try if i really can, im not sure =( )
well, for the meantime.. my codes got rumbled, i don't understand them anymore.. but it does give the ff. options..
[1]Add entry
[2]Delete entry
[3]Display list
[4]Search
[5]Save
[6]Load
[7]Quit
and hey, i'd really be so glad if you post some help! (ow, this is for my project anyway..) x] thanks
4 6358
And what is your question? You can't expect us to finish your code without even knowing what it's supposed to do.
kind regards,
Jos
ps. The indentation (almost none and inconsistent) of your code stinks.
@JosAH
>> aw, im so sorry.. hmf.
my questions :
1.are the codes correct?what's wrong with it? i couldn't check them my own, cos it too doesn't run. it tells some "expression/ declaration syntax in main function, statement missing".. please help? i just couldn't finish coding it now. [cos, i haven't sleep yet.
thanks.
@shaieen
Take some good night sleep first. Compile everything tomorow and post the compiler error message which you don't understand. Your questions now are similar to "do my work for me" and we won't do that.
kind regards,
Jos
guys ,, can anyone post a link on matrix effect code for turbo c?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Hans-Joachim Widmaier |
last post by:
Hi all.
Handling files is an extremely frequent task in programming, so most
programming languages have an abstraction of the basic files offered by
the underlying operating system. This is...
|
by: Josh |
last post by:
Hi,
I am having a problem with Python. I am new to Python as a programming
language, but I do have experience in other languages. I am
experiencing strange problems with File handling and wonder...
|
by: Sean W. Quinn |
last post by:
Hey folks,
I have a question regarding file handling, and the preservation of class
structure. I have a class (and I will post snippets of code later in the
post) with both primitive data...
|
by: Jay Kim |
last post by:
Hi,
We're implementing a Windows application using Visual
Basic .NET.
One of the key features we need to implement is that we
should be able to get the accurate byte offset of user
selected...
|
by: BHARAT |
last post by:
Hi I am a little bit new to C's advanced topics:
I need help in file handling.
I have Turbo C and I wrote a simple program to write data to file:
#include<stdio.h>
#include<dir.h>...
|
by: D & J G |
last post by:
Is there a way to instruct Windows file-handling - 'Opens with:' - from
within VB6? I want to ensure that files with the .rtf (rich text) extension
always go to Word Pad, no matter which future...
|
by: Binu C |
last post by:
hi am new to VB. I need to develop an application. The requirements are
as follows:
We have a notepad which consists of some data(Say A). Now we have a
form in which we have some text fields & a...
|
by: lokeshrajoria |
last post by:
hello everybody,
i need some help in binary file handling in perl. can anybody give me some information about binary file. actully i am reading data from some text file and extracting some usefull...
|
by: neha_chhatre |
last post by:
hey please help me execute the code on ubuntu in C
#include<stdio.h>
#include<stdlib.h>
int main()
{
FILE *fp;
char ch;
float ticktock;
|
by: phpmagesh |
last post by:
Hi,
I want to create a xml document using php-file handling . that i have a Database named as Total_category and table name as students_one.
and i have fields like name, age, email, title,...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |