Results 1 to 4 of 4
  1. #1

    Default turbo c, address book.. pahelp


    Hello mga bro ug mga miga.. magpatabang lng unta ko ani nga program.. Nakahimu na ko add entry ug view entry. Unsaon mn nako pag search, edit and delete>? here are my starting codes.. just a pipitsuging 1st yr comsci.. pls share your ideas.. for address book ni.. thankss..!

    #include <stdio.h>
    #include <conio.h>
    #include <string.h>
    #include <stdlib.h>
    struct person
    {
    char fname[20];
    char lname[15];
    char address[50];
    char telephone[10];
    };
    char Selection(char choice)
    {
    printf("a. Data Entry");
    printf("\nb. Search and Edit a Record");
    printf("\nc. Search and Delete a Record");
    printf("\nd. Display all Records");
    printf("\ne. Exit from the program");
    printf("\n\nEnter your choice: ");
    scanf(" %c",&choice);
    return choice;
    }
    int Data_Entry (struct person prson[20])
    {
    char fn[20], ln[15], addy[30], tphone[10];
    int i;
    printf("Enter info for student no. %d",i+1); gets("\n");
    printf("\nFirst Name: "); gets(fn);
    strcpy(prson[i].fname, fn);
    printf("Last Name: "); gets(ln);
    strcpy(prson[i].lname, ln);
    printf("Address: "); gets(addy);
    strcpy(prson[i].address, addy);
    printf("Telephone No.: "); gets(tphone);
    strcpy(prson[i].telephone, tphone);
    i++;
    return i;
    }
    Display(struct person prson[20], int i)
    {
    int j, y=3;
    clrscr();
    printf("Name Address Tel. No.");
    for (j=0;j<i;j++ )
    {
    gotoxy(1,y);printf("%s, %s",prson[j].lname, prson[j].fname);
    gotoxy(30,y);printf("%s",prson[j].address);
    gotoxy(60,y);printf("%s",prson[j].telephone);
    y++;
    }
    getch();
    }
    typedef struct person prson;
    main()
    {
    int i=0;
    struct person prson[20];
    char choice='';
    do
    {
    clrscr();
    choice=Selection(choice);
    if ( choice=='a' ) {
    clrscr();
    i=Data_Entry(prson); }
    if ( choice=='d' )
    Display(prson, i);
    } while ( choice!='e' );
    printf("\n\n\n Good Bye!");
    getch();
    }

  2. #2

    Default Re: turbo c, address book.. pahelp

    Kaya kaau na nimu bai.. discover blue lang.. basta saun ra kaau nang search, sa pag edit e kuan lang overwrite, tapos sa pag delete e null ra.. basta kaya ra na..nag File handling mu? sayang kung wala na corrupt ako flashdrive naa tana dd2 ako library system C prog. ghpon ang gamit.. Godbless!

    P.S Google is your Friend!

  3. #3

    Default Re: turbo c, address book.. pahelp

    sauna amu project sa turbo C kay ATM using database pero file handling...dali ra na..

  4. #4

    Default Re: turbo c, address book.. pahelp

    kn mag search, himu pud kag another loop pra mu check sa entry sa every array nimu, d size of the search loop depends on the size sa imu array, then himu lang ka conditional statement everytime mu check sya sa array mu check pud siya sa imu g search na char/string.

    same ghapon sa edit ug delete, gamite lang switch statement pra dali ra error trapping.

  5.    Advertisement

Similar Threads

 
  1. Replies: 3273
    Last Post: 04-16-2021, 11:09 AM
  2. Book Fellas (Open-to-all Reading Club)
    By josephdc in forum Arts & Literature
    Replies: 1392
    Last Post: 08-31-2020, 08:58 AM
  3. Istoryan Readers: Book reviews and recommendations~
    By Carlo Borromeo in forum Arts & Literature
    Replies: 431
    Last Post: 09-13-2015, 12:27 PM
  4. Book places here in Cebu
    By bahmat in forum Arts & Literature
    Replies: 48
    Last Post: 06-16-2010, 01:18 PM
  5. Who's the most influential comic book character of all time?
    By Uzumaki Naruto in forum Arts & Literature
    Replies: 88
    Last Post: 08-08-2007, 12:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top