Hi Experts,
I've got a school assigment in c language programming but this course is new to me.
Q. Create 5 users - the 5th user would be the admin
Admin would have privilledge to view user profile and disable user account.
User Profile:
Name, D.O.B, Gender, Occupation, Contact, Income p/n...etc.

To be true I don't uderstand how to add this to this program;

#include<stdio.h>
int x;   char y;
float with,bal = 880000.80f,dep;

void withdraw(void);    void deposit(void);
void balance(void);

void main()
{
    clrscr();
    printf("##########################MAYBANK##########################");
    printf("\n\n\t##To Check Balance:  Press 1");
    puts("\n\n\t##To Withdraw:    Press 2");
    puts("\n\n\t##To Deposit:   Press 3");
    puts("\n\n\t##ENTER YOUR CHOICE:     ");
    scanf("%d",&x);
    switch(x)
    {
        case 1: balance(); break;
        case 2: withdraw(); break;
        case 3: deposit();  break;
        default: printf("\n\n\t\tINVALID INPUT SELECTION");
             getch();

    }
    getch();
}

void balance()
{
    clrscr();
    printf("Your Current Amount Is:  PGK  %.2f",bal);
    getch();
    main();
}

void withdraw()
{
    clrscr();
    printf("##########################MAYBANK##########################");
    printf("\n\n\t\tENTER AMOUNT:  PGK  "); scanf("%f",&with);
    if(with>bal)
    {
    printf("\n\n\t\tAMOUNT INSUFFICIENT FOR WITHDRAWL");
    getch();
    withdraw();
    }
    else
    bal-=with;
    printf("\n\n\t\tWITHDRAW SUCCESSFUL YOUR CURRENT BALANCE IS NOW:  %.2f",bal);
    printf("\n\n\t\tDo You Want To Make Another Withdrawl ? Y/N    ");
    y=getch();

    if(y=='y'||y=='Y')
    withdraw();
    else
    printf("\n\n\t\tTHANKYOU FOR BANKING WITH MAYBANK...");
}

void deposit()
{
    clrscr();
    printf("##########################MAYBANK##########################");
    printf("\n\n\t\t");
    printf("\n\n\t\t");
}

well to add user profile , you must allow the end-users to insert their values .

if you know about struct then you can do it easily , otherwise create a new function and declare sperate variable for each information and save values to those variables.

and i think that you will need to store these values to file also(for further reference), so you must be familiar with file manipulation functions.

atleast a sample code for adding users and their profile would be great. Like said I'm just a beginner who started last week and bumped my face with this problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.