Hello po, patulong naman kung alam niyo po pano gawin huhu. Simple Bank Account System po yung kailangan kong gawin, its inclusion are (1)Balance, (2) Deposit, (3)wí†hdráw, (4)Create new user. May nagawa na po ako na code pero di ko alam pano gawin yung "create new user" tapos ano yung ilalagay sa line24 . Tapos kailangan naka loop siya.
Thank you po T_T
#include<stdio.h>
unsigned long amount = 0, deposit, wí†hdráw;
int choice, user, k;
char transaction = 'y';
int userchoice;
char username[70];
int main()
{
printf("KrAzYy BaNk");
printf("\nPress 1 to enter user");
printf("\nPress 2 to create new user");
printf("\n*****************************");
printf("\n\nEnter your choice: ");
scanf("%d", &userchoice);
if (userchoice ==1){
printf("\n\nUsername: ");
fgets(username, 70, stdin);
printf("Username: %s");
if (username == ){
printf("\n*Welcome to KrAzYy BaNk*");
printf("\n1. Check Balance");
printf("\n2. Cash wí†hdráwal");
printf("\n3. Cash Deposition");
printf("\n4. Exit");
printf("\n************************************");
printf("\n\nEnter you choice: ");
scanf("%d", &choice);
switch(choice)
{
case 1:
printf("\nYour BALANCE is %lu", amount);
break;
case 2:
printf("\n Enter the amount to wí†hdráw: ");
scanf("%lu", &wí†hdráw);
if (wí†hdráw % 100 != 0)
{
printf("\n Please enter the amount in multiples of 100");
} else if (wí†hdráw > (amount - 500))
{
printf("\n INSUFICIENT BALANCE");
}
else
{
amount = amount - wí†hdráw;
printf("\n\nPLEASE COLLECT CASH");
printf("\nYour current balance is %lu",amount);
}
break;
case 3:
printf("\nEnter the amount to DEPOSIT: ");
scanf("%lu", &deposit);
amount = amount = deposit;
printf("\nYour balance is %lu", amount);
break;
case 4:
printf("\nThank you for using KrAzYy BaNk");
break;
defualt:
printf("\nInvalid Choice");
}
printf("\n\n*KrAzYy BaNk*");
printf("\nPress 1 to enter user");
printf("\nPress 2 to create new user");
printf("\n*****************************");
printf("\n\nEnter your choice: ");
scanf("%d", &userchoice);
fflush(stdin);
return 0;
}
}
}
Thank you po T_T
#include<stdio.h>
unsigned long amount = 0, deposit, wí†hdráw;
int choice, user, k;
char transaction = 'y';
int userchoice;
char username[70];
int main()
{
printf("KrAzYy BaNk");
printf("\nPress 1 to enter user");
printf("\nPress 2 to create new user");
printf("\n*****************************");
printf("\n\nEnter your choice: ");
scanf("%d", &userchoice);
if (userchoice ==1){
printf("\n\nUsername: ");
fgets(username, 70, stdin);
printf("Username: %s");
if (username == ){
printf("\n*Welcome to KrAzYy BaNk*");
printf("\n1. Check Balance");
printf("\n2. Cash wí†hdráwal");
printf("\n3. Cash Deposition");
printf("\n4. Exit");
printf("\n************************************");
printf("\n\nEnter you choice: ");
scanf("%d", &choice);
switch(choice)
{
case 1:
printf("\nYour BALANCE is %lu", amount);
break;
case 2:
printf("\n Enter the amount to wí†hdráw: ");
scanf("%lu", &wí†hdráw);
if (wí†hdráw % 100 != 0)
{
printf("\n Please enter the amount in multiples of 100");
} else if (wí†hdráw > (amount - 500))
{
printf("\n INSUFICIENT BALANCE");
}
else
{
amount = amount - wí†hdráw;
printf("\n\nPLEASE COLLECT CASH");
printf("\nYour current balance is %lu",amount);
}
break;
case 3:
printf("\nEnter the amount to DEPOSIT: ");
scanf("%lu", &deposit);
amount = amount = deposit;
printf("\nYour balance is %lu", amount);
break;
case 4:
printf("\nThank you for using KrAzYy BaNk");
break;
defualt:
printf("\nInvalid Choice");
}
printf("\n\n*KrAzYy BaNk*");
printf("\nPress 1 to enter user");
printf("\nPress 2 to create new user");
printf("\n*****************************");
printf("\n\nEnter your choice: ");
scanf("%d", &userchoice);
fflush(stdin);
return 0;
}
}
}