hi there i am new to this forum and very new to c programming
i do need any of u guyzz there to help me with my assignment
i need to do a simple bank program asking the user password at first with the menu:
1. withdraw
2. balance enquiry
3. change password
4. exit
and i do need to know how to declare clrscr();
i dont know hot to clear screen, how to exit, and when a user selects a menu..... he must return to the main containing the the above thing, and i dont even know how make the change in password coz i use if statement for my password.... is there any other way?
this is my coding... i havent done much but plz help me
and i hope u guyz can help me fast with this
#include<stdio.h>
int password,menu,new_password;
float balance,withdraw,withdraw_after;
main()
{
printf("PLEASE ENTER YOUR PASSWORD:\t");
scanf("%d",&password);
if(password==123456)
{
balance=1500;
printf("MENU SCREEN\n");
printf("1. Withdraw\n");
printf("2. Balance Enquiry\n");
printf("3. Change Password\n");
printf("4. Exit\n\n");
printf("Select A Menu:\t");
scanf("%d",&menu);
switch(menu)
{
case 1:
printf("Withdraw Menu\n\n");
printf("User Name:\t Tony");
printf("Account Balance:\t RM %.2f",balance);
printf("Enter The Amount You Want To Withdraw:\t");
scanf("%f",&withdraw);
if(withdraw>balance)
{
printf("You Don't Have Enough Money In Your Account");
}
else
{
withdraw_after=balance-withdraw;
printf("You Have RM %.2f Left In Your Account",withdraw_after);
}
break;
case 2:
printf("Balance Enquiry Menu\n");
printf("User Name:\t Tony");
printf("Account Balance:\t RM %.2f",balance);
break;
case 3:
printf("Change Password Menu");
printf("Please Enter A New Password:\t");
scanf("%d",new_password);
password=new_password;
break;
case 4:
break;
}
}
}