Question
Here are requirements of a C code. I think it is not difficult for you because i have deleted some requirements. (I think it will be better if user can choose their identification once runned).
Please write in C and give some explains!

Overall description: Your team is employed by a bank to implement a system to manage the banking affairs. Customer specificat
Allow the following banking activities: o Display current account balance. o Allow withdrawals from an account. o Register a
System Users
Bank clerk who will be able to: o Add/delete/edit accounts for an existing customer. o Make deposits to a customers account.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>

#include <conio.h>

#include <string.h>

#include <stdlib.h>

// Structure declaration

struct acc_type

{

     char bank_name[20];

     char bank_branch[20];

     char acc_holder_name[30];

     int acc_number;

     char acc_holder_address[100];

     float available_balance;    

};

struct acc_type account[20];

/*

     printf("The above structure can be declared using

     typedef like below");

     typedef struct acc_type

     {

        char bank_name[20];

        char bank_branch[20];

        char acc_holder_name[30];

        int acc_number;

        char acc_holder_address[100];

        float available_balance;    

     }Acc_detail;

     Acc_detail account[20];

*/

int num_acc;

void Create_new_account();

void Cash_Deposit();

void Cash_withdrawl();

void Account_information();

void Log_out();

void display_options();

/* main program */

int main()

{

    char option;

    char f2f[50] = "http://fresh2refresh.com/";

    num_acc=0;

    while(1)

    {

       printf("\n***** Welcome to Bank Application *****\n");

       printf("\nThis demo program is brought you by %s",f2f);

       display_options();

       printf("Please enter any options (1/2/3/4/5/6) ");

       printf("to continue : ");

        option = getch();

        printf("%c \n", option);

        switch(option)

        {

          case '1': Create_new_account();

                    break;

          case '2': Cash_Deposit();

                    break;

          case '3': Cash_withdrawl();

                    break;

          case '4': Account_information();

                    break;

          case '5': return 0;

          case '6': system("cls");

                    break;

          default : system("cls");

                    printf("Please enter one of the options");

                    printf("(1/2/3/4/5/6) to continue \n ");

                    break;

        }

    }

    return 0;

}

/*Function to display available options in this application*/

void display_options()

{

    printf("\n1. Create new account \n");

    printf("2. Cash Deposit \n");

    printf("3. Cash withdrawl \n");

    printf("4. Account information \n");

    printf("5. Log out \n");

    printf("6. Clear the screen and display available ");

    printf("options \n\n");

}

/* Function to create new account */

void Create_new_account()

{

   char bank_name[20];

   char bank_branch[20];

   char acc_holder_name[30];

   int acc_number;

   char acc_holder_address[100];

   float available_balance = 0;

   fflush(stdin);    

   printf("\nEnter the bank name              : ");

   scanf("%s", &bank_name);

   printf("\nEnter the bank branch            : ");

   scanf("%s", &bank_branch);

   printf("\nEnter the account holder name    : ");

   scanf("%s", &acc_holder_name);

   printf("\nEnter the account number(1 to 10): ");

   scanf("%d", &acc_number);

   printf("\nEnter the account holder address : ");

   scanf("%s", &acc_holder_address);

   strcpy(account[acc_number-1].bank_name,bank_name);

   strcpy(account[acc_number-1].bank_branch,bank_branch);

   strcpy(account[acc_number-1].acc_holder_name,

   acc_holder_name);

   account[acc_number-1].acc_number=acc_number;

   strcpy(account[acc_number-1].acc_holder_address,

   acc_holder_address);

   account[acc_number-1].available_balance=available_balance;

   printf("\nAccount has been created successfully \n\n");

   printf("Bank name              : %s \n" ,

   account[acc_number-1].bank_name);

   printf("Bank branch            : %s \n" ,

   account[acc_number-1].bank_branch);

   printf("Account holder name    : %s \n" ,

   account[acc_number-1].acc_holder_name);

   printf("Account number         : %d \n" ,

   account[acc_number-1].acc_number);

   printf("Account holder address : %s \n" ,

   account[acc_number-1].acc_holder_address);

   printf("Available balance      : %f \n" ,

   account[acc_number-1].available_balance);

   //num_acc++;

}

// Displaying account informations

void Account_information()

{

     register int num_acc = 0;

     //if (!strcmp(customer,account[count].name))

     while(strlen(account[num_acc].bank_name)>0)

     {

         printf("\nBank name                : %s \n" ,

         account[num_acc].bank_name);

         printf("Bank branch              : %s \n" ,

         account[num_acc].bank_branch);

         printf("Account holder name      : %s \n" ,

         account[num_acc].acc_holder_name);

         printf("Account number           : %d \n" ,

         account[num_acc].acc_number);

         printf("Account holder address   : %s \n" ,

         account[num_acc].acc_holder_address);

         printf("Available balance        : %f \n\n" ,

         account[num_acc].available_balance);

         num_acc++;

     }

}

// Function to deposit amount in an account

void Cash_Deposit()

{

   auto int acc_no;

   float add_money;

   printf("Enter account number you want to deposit money:");

   scanf("%d",&acc_no);

   printf("\nThe current balance for account %d is %f \n",

   acc_no, account[acc_no-1].available_balance);

   printf("\nEnter money you want to deposit :  ");

   scanf("%f",&add_money);

   while (acc_no=account[acc_no-1].acc_number)

   {

         account[acc_no-1].available_balance=

         account[acc_no-1].available_balance+add_money;

         printf("\nThe New balance for account %d is %f \n",

         acc_no, account[acc_no-1].available_balance);

         break;

   }acc_no++;

}

// Function to withdraw amount from an account

void Cash_withdrawl()

{

   auto int acc_no;

   float withdraw_money;

   printf("Enter account number you want to withdraw money:");

   scanf("%d",&acc_no);

   printf("\nThe current balance for account %d is %f \n",

   acc_no, account[acc_no-1].available_balance);

   printf("\nEnter money you want to withdraw from account ");

   scanf("%f",&withdraw_money);

   while (acc_no=account[acc_no-1].acc_number)

   {

         account[acc_no-1].available_balance=

         account[acc_no-1].available_balance-withdraw_money;

         printf("\nThe New balance for account %d is %f \n",

         acc_no, account[acc_no-1].available_balance);

         break;

   }acc_no++;

}

Add a comment
Know the answer?
Add Answer to:
Here are requirements of a C code. I think it is not difficult for you because...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • If you could please assist me with this C# assignment. Screenshots would be greatly appreciated! Create...

    If you could please assist me with this C# assignment. Screenshots would be greatly appreciated! Create a Windows application using C# visual studio that functions like a banking account register. The graphical user interface should initially allow the user to input the account name, number, and initial balance. Ensure that the full name is entered for the customer and that only numeric values are entered for number fields when the Create Account button is selected. Separate the business logic from...

  • First, draw an EER that models the given requirements. You will play with the Bank Database...

    First, draw an EER that models the given requirements. You will play with the Bank Database in this homework. Please download and execute the bank.sql from Canvas to create this database in your MySQL system. Please submit the results as a zip file with a name <yourname>-bank.zip. Consider modeling a bank: . The bank keeps personal information of each customer including name, sex, address, phone number, social security number, and date of birth. . Each customer owns one or more...

  • C++ Simple code please Thank you in advance B. Write a C++ program as per the...

    C++ Simple code please Thank you in advance B. Write a C++ program as per the following specifications: a. Define the class BankAccount to store a bank customer's account number and balance. Suppose that account number is of type int, and balance is of type double. Your class should, at least, provide the following operations: set the account number, retrieve the account number, retrieve the balance, deposit and withdraw money, and print account information. Add appropriate constructors. b. Every bank...

  • Programming Assignment 5: UML Diagram Objectives: After successfully completing this assignment, students will practice Object Oriented...

    Programming Assignment 5: UML Diagram Objectives: After successfully completing this assignment, students will practice Object Oriented design by creating an UML diagram for a Java program. Program Statement: Bank System You were asked to create a simple UML diagram for a bank system. Each bank has a specific identification number, a name, and a location that needs to be stored. Tellers serve customers’ loans, checking and savings accounts. The bank must know each tellers’ name and identification number for record...

  • Most grocery stores use bar code scanning technologies that interface with cash registers used to process...

    Most grocery stores use bar code scanning technologies that interface with cash registers used to process customer purchases. Cashiers use the scanners to read bar code labels attached to each product, which the system then uses to obtain unit prices, calculate transaction totals, including sales taxes, and update perpetual inventory databases. Similarly, cashiers scan bar codes on coupons or member discount cards presented by the customer to process discounts. Along with the scanning technologies, groceries use point-of-sale technologies that allow...

  • write a code on .C file Problem Write a C program to implement a banking application...

    write a code on .C file Problem Write a C program to implement a banking application system. The program design must use a main and the below functions only. The program should use the below three text files that contain a set of lines. Sample data of these files are provided with the assessment. Note that you cannot use the library string.h to manipulate string variables. For the file operations and manipulations, you can use only the following functions: fopen(),...

  • Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the...

    Need some help with this C++ code. Please screenshot the code if possible. Purpose: Demonstrate the ability to create and manipulate classes, data members, and member functions. This assignment also aims at creating a C++ project to handle multiple files (one header file and two .cpp files) at the same time. Remember to follow documentation and variable name guidelines. Create a C++ project to implement a simplified banking system. Your bank is small, so it can have a maximum of...

  • I need help with this code. I'm using C++ and Myprogramming lab to execute it. 11.7:...

    I need help with this code. I'm using C++ and Myprogramming lab to execute it. 11.7: Customer Accounts Write a program that uses a structure to store the following data about a customer account:      Customer name      Customer address      City      State      ZIP code      Telephone      Account balance      Date of last payment The program should use an array of at least 20 structures. It should let the user enter data into the array, change the contents of any element, and display all the...

  • Boston high students want to open their own shop to sell things for their customers. For...

    Boston high students want to open their own shop to sell things for their customers. For instance, they can open a business of their own that sell things such as electronic devices ,drones ,books, clothing, or anything. Therefore they must use a customized program for their shops. The program is like stocks inventory and sales systems combined into one system. For example to develop Management Retailer System (Stock Inventory and Customer Sales). The program must be able to calculate and...

  • Please help me with the code. Thank you! Description James Vond has delivered us some intel...

    Please help me with the code. Thank you! Description James Vond has delivered us some intel that the enemy perpetrators have been tricked into going to a bank that we've wired and booby-trapped. However, we have not gotten a bank system in place and you are the only person who is capable of handling such a task. We need this plan to go off without a hitch because the money we'll be receiving will give us insight on the hideout's...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT