Thread: Help Me!
View Single Post
  #1 (permalink)  
Old 03-30-2008, 01:43 PM
helpplease helpplease is offline
Newbie
 
Join Date: Mar 2008
Posts: 2
Rep Power: 0
helpplease is on a distinguished road
Default Help Me!

I'm suppose to create a program for a commercial bank.
The program should start with the following menu:
Press 1. To add new customer
2. To carry out a transaction
3. To exit
If the user selects 1 the program should ask for name, address, telephone number and the amount depositing.
If the user selects 2 he is given another menu.
Press 1. For Withdrawal
2.For Deposit
3. For Enquiry
If the user selects 1 which is withdrawal, he/she should ask the user for their customer no. and the amount to withdraw.
If the user select 2 which is deposit ask the user for customer
number and the amount to deposit.
If the user selects 3 ask for the customer number and print the customers balance.
After each transaction print the users balance.

This is what i have so far:

c Code:
  1. #include<stdio.h>
  2. #include<string.h>
  3. #include<stdlib.h>
  4.  
  5. int gun;
  6. int cat;
  7. int potion;
  8. int hate;
  9. int dagger;
  10. int wow;
  11. int token;
  12. char name[100];
  13. char address[100];
  14. int tagger;
  15. int myarray[7];
  16.  
  17. void menu_option() {
  18. printf("\n Welcome to Saleem's Commercial Bank");
  19.             printf("\n Press 1 if you are a new customer\n Press 2 if you want to carry out a transaction\n");
  20.             printf("\n Press 3 to exit the system");
  21.             printf("n\n Your choice->");
  22.             scanf("%d",&dagger);
  23. }
  24.  
  25.            void option_two(){
  26.                 switch(wow)
  27.                      {
  28.                       case 1: printf("\n Please enter your customer number");
  29.                       scanf("%d",&potion);
  30.                        printf("\n Please enter the amount you are withdrawing");
  31.                       scanf("%d",&cat);
  32.                             break;
  33.                              
  34.                 case 2: printf("\n Please enter your customer number");
  35.                               scanf("%d",&gun);
  36.                               printf("\n Please enter the amount your depositing");
  37.                               scanf("%d",&hate);
  38.                               break;
  39.                  
  40.                 default:("\n Please try again");
  41.                     }
  42.             }
  43.            
  44.    int main()
  45.    {
  46.        menu_option();
  47.         struct customer_information
  48.    {
  49.        char name[100];
  50.        char address[200];
  51.        int token;
  52.       
  53.    };
  54.     switch(dagger)
  55.     {
  56.        struct customer_information  person1;
  57.        {
  58.     case 1: printf("Please enter your name\n");
  59.             scanf("%s",name);
  60.  
  61.             printf("Please enter your address\n");
  62.             scanf("%s",&address);
  63.  
  64.             printf("Please enter your telephone number\n");
  65.             scanf("%d",&token);
  66.            
  67.             printf("Please enter the amount your depositing\n");
  68.             scanf("%d",&tagger);
  69.             
  70.             break;
  71.        };
  72.  
  73.        case 2printf("\n Please select the suitable option");
  74.                 printf("\n Press 1 for withdrawal\n Press 2 for deposit\n");
  75.                 printf("\n Press 3 enquiry");
  76.                 printf("n\n Your choice->");
  77.                 scanf("%d",&wow);
  78.                        break;
  79.    
  80.        case 3:printf("\n Thank You for using Saleem's Commercial Bank");
  81.                             break;
  82.    
  83.        default: printf("\n The number you pressed is invalid. Please try again");
  84.             menu_option();
  85.    
  86.     }
  87.                    option_two();
  88.  
  89.     return 0;
  90.    }

I am having problems with assigning customer numbers and also
in printing the balances.

Last edited by Jaan; 04-01-2008 at 01:11 AM. Reason: Use tags when you're posting your codes!
Reply With Quote

Sponsored Links