Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A bank is building a new software in C. The requirements for this software are t

ID: 3838339 • Letter: A

Question


A bank is building a new software in C. The requirements for this software are the following: 1) There should be 2 types of accounts, an administrator account and a customer account. To start off the administrator account user must be “admin” (login), “admin” (password)
2) The login screen should allow both administrator and Customer to login to the system Welcome to Online Banking/ATM System ==================================== Enter your Customer/Admin ID: 12345 OR admin Enter your Customer/Admin Password: XXXXX OR admin 3) The administrator shall be able to login to the system. The system should detect when an administrator has logged in. Once logged in she/he shall be able to see a menu as shown below Welcome to Online Banking/ATM System ==================================== ------------------------- Administrator Menu ------------------------- 1) Create Customer account 2) Change Password 3) View Customer Info 4) Change Customer Info 5) Delete Customer account 6) Show Top 5 accounts 7) Show customer accounts alphabetically 8) Exit 1) Administrator shall be able to create a customer account 2) Administrator shall be able to change his/her own password 3) Administrator shall be able to view customer information 4) Administrator shall be able to change/edit a customer information 5) Administrator shall be able to delete a customer/account 6) Administrator shall be able to view the top 5 accounts (ordered by max balance) 7) Administrator shall be able to view accounts by alphabetical choice. E.g. list all customers whose last name begins with “s” 8) Administrator shall be able to exit the system 4) The Customer should be able to login to the system. The system should be able to detect that a Customer has logged in. Once logged in he should be able to see a menu as shown below Welcome to Online Banking/ATM system ==================================== -------------------- Customer Menu -------------------- a) Change Password b) View Customer information c) View Balance d) Make a Deposit e) Transfer Money f) Withdraw Money g) Exit a) Customer shall be able to change his/her own password b) Customer shall be able to view his/her information c) Customer shall be able to view account balance d) Customer shall be able to deposit into his account e) Customer shall be able to withdraw from his/her account f) Customer shall be able to transfer money from his account to another customer’s account using customer ID g) Customer shall be able to exit the system Details: All the customer data will reside on a single line in a CustomerData.txt file with the following format. Each field is separated by a single blank. Customer First Name: 8 characters Customer Last Name: 8 characters Customer City: 10 characters Customer State: 2 characters Customer Phone: XXX-XXXX (7 characters) Account Number/Customer ID: XXXXX (5 digits) Password: XXXXX (6 characters) Account Balance: (Double) Every time an administrator or a customer accesses the information from the menu, the data from the file will be downloaded into the program into an array of structure. The specific customer record will be located and a local copy made for any changes that need to be made. Once the changes are made, upon exit from the menu, the local record will be updated into the main array of records and written back to the file. When a customer/administrator accesses the data, a lock (implemented as a file) will be activated which will disallow anyone from accessing the file till such a time that the lock is released. When customer/administrator exits the menu, the lock is released. Administrator can add customer by entering details for new customers or an initial file version may contain all of the information which is a starting data for the system. You will use structured programming techniques to design a solution to this problem Care must be taken to have a detailed low level design/pseudocode ready before any code is written for this project. You will have 3 source code files at a minimum. All of the Administrator functionality must be written in administrator.c source file. All of the Customer functionality must be written in customer.c file. You will also create a main.c file that will be responsible for serving the menu for the Customer and the Administrator. You will compile and build the “banksystem” object. You will run your program by entering the command line on the Linux/Unix system as below: “banksystem CustomerData.txt” Thus, you will also design the main function with argc and argv[] as parameters. Exception Handling:You must implement all possible exception handling that is needed to ensure that the program does not crash on invalid inputs. You must also ensure that the bank does not go into a loss because you allow customer to withdraw an amount greater than the balance.

A bank is building a new software in C. The requirements for this software are the following: 1) There should be 2 types of accounts, an administrator account and a customer account. To start off the administrator account user must be “admin” (login), “admin” (password)
2) The login screen should allow both administrator and Customer to login to the system Welcome to Online Banking/ATM System ==================================== Enter your Customer/Admin ID: 12345 OR admin Enter your Customer/Admin Password: XXXXX OR admin 3) The administrator shall be able to login to the system. The system should detect when an administrator has logged in. Once logged in she/he shall be able to see a menu as shown below Welcome to Online Banking/ATM System ==================================== ------------------------- Administrator Menu ------------------------- 1) Create Customer account 2) Change Password 3) View Customer Info 4) Change Customer Info 5) Delete Customer account 6) Show Top 5 accounts 7) Show customer accounts alphabetically 8) Exit 1) Administrator shall be able to create a customer account 2) Administrator shall be able to change his/her own password 3) Administrator shall be able to view customer information 4) Administrator shall be able to change/edit a customer information 5) Administrator shall be able to delete a customer/account 6) Administrator shall be able to view the top 5 accounts (ordered by max balance) 7) Administrator shall be able to view accounts by alphabetical choice. E.g. list all customers whose last name begins with “s” 8) Administrator shall be able to exit the system 4) The Customer should be able to login to the system. The system should be able to detect that a Customer has logged in. Once logged in he should be able to see a menu as shown below Welcome to Online Banking/ATM system ==================================== -------------------- Customer Menu -------------------- a) Change Password b) View Customer information c) View Balance d) Make a Deposit e) Transfer Money f) Withdraw Money g) Exit a) Customer shall be able to change his/her own password b) Customer shall be able to view his/her information c) Customer shall be able to view account balance d) Customer shall be able to deposit into his account e) Customer shall be able to withdraw from his/her account f) Customer shall be able to transfer money from his account to another customer’s account using customer ID g) Customer shall be able to exit the system Details: All the customer data will reside on a single line in a CustomerData.txt file with the following format. Each field is separated by a single blank. Customer First Name: 8 characters Customer Last Name: 8 characters Customer City: 10 characters Customer State: 2 characters Customer Phone: XXX-XXXX (7 characters) Account Number/Customer ID: XXXXX (5 digits) Password: XXXXX (6 characters) Account Balance: (Double) Every time an administrator or a customer accesses the information from the menu, the data from the file will be downloaded into the program into an array of structure. The specific customer record will be located and a local copy made for any changes that need to be made. Once the changes are made, upon exit from the menu, the local record will be updated into the main array of records and written back to the file. When a customer/administrator accesses the data, a lock (implemented as a file) will be activated which will disallow anyone from accessing the file till such a time that the lock is released. When customer/administrator exits the menu, the lock is released. Administrator can add customer by entering details for new customers or an initial file version may contain all of the information which is a starting data for the system. You will use structured programming techniques to design a solution to this problem Care must be taken to have a detailed low level design/pseudocode ready before any code is written for this project. You will have 3 source code files at a minimum. All of the Administrator functionality must be written in administrator.c source file. All of the Customer functionality must be written in customer.c file. You will also create a main.c file that will be responsible for serving the menu for the Customer and the Administrator. You will compile and build the “banksystem” object. You will run your program by entering the command line on the Linux/Unix system as below: “banksystem CustomerData.txt” Thus, you will also design the main function with argc and argv[] as parameters. Exception Handling:You must implement all possible exception handling that is needed to ensure that the program does not crash on invalid inputs. You must also ensure that the bank does not go into a loss because you allow customer to withdraw an amount greater than the balance.

A bank is building a new software in C. The requirements for this software are the following: 1) There should be 2 types of accounts, an administrator account and a customer account. To start off the administrator account user must be “admin” (login), “admin” (password)
2) The login screen should allow both administrator and Customer to login to the system Welcome to Online Banking/ATM System ==================================== Enter your Customer/Admin ID: 12345 OR admin Enter your Customer/Admin Password: XXXXX OR admin 3) The administrator shall be able to login to the system. The system should detect when an administrator has logged in. Once logged in she/he shall be able to see a menu as shown below Welcome to Online Banking/ATM System ==================================== ------------------------- Administrator Menu ------------------------- 1) Create Customer account 2) Change Password 3) View Customer Info 4) Change Customer Info 5) Delete Customer account 6) Show Top 5 accounts 7) Show customer accounts alphabetically 8) Exit 1) Administrator shall be able to create a customer account 2) Administrator shall be able to change his/her own password 3) Administrator shall be able to view customer information 4) Administrator shall be able to change/edit a customer information 5) Administrator shall be able to delete a customer/account 6) Administrator shall be able to view the top 5 accounts (ordered by max balance) 7) Administrator shall be able to view accounts by alphabetical choice. E.g. list all customers whose last name begins with “s” 8) Administrator shall be able to exit the system 4) The Customer should be able to login to the system. The system should be able to detect that a Customer has logged in. Once logged in he should be able to see a menu as shown below Welcome to Online Banking/ATM system ==================================== -------------------- Customer Menu -------------------- a) Change Password b) View Customer information c) View Balance d) Make a Deposit e) Transfer Money f) Withdraw Money g) Exit a) Customer shall be able to change his/her own password b) Customer shall be able to view his/her information c) Customer shall be able to view account balance d) Customer shall be able to deposit into his account e) Customer shall be able to withdraw from his/her account f) Customer shall be able to transfer money from his account to another customer’s account using customer ID g) Customer shall be able to exit the system Details: All the customer data will reside on a single line in a CustomerData.txt file with the following format. Each field is separated by a single blank. Customer First Name: 8 characters Customer Last Name: 8 characters Customer City: 10 characters Customer State: 2 characters Customer Phone: XXX-XXXX (7 characters) Account Number/Customer ID: XXXXX (5 digits) Password: XXXXX (6 characters) Account Balance: (Double) Every time an administrator or a customer accesses the information from the menu, the data from the file will be downloaded into the program into an array of structure. The specific customer record will be located and a local copy made for any changes that need to be made. Once the changes are made, upon exit from the menu, the local record will be updated into the main array of records and written back to the file. When a customer/administrator accesses the data, a lock (implemented as a file) will be activated which will disallow anyone from accessing the file till such a time that the lock is released. When customer/administrator exits the menu, the lock is released. Administrator can add customer by entering details for new customers or an initial file version may contain all of the information which is a starting data for the system. You will use structured programming techniques to design a solution to this problem Care must be taken to have a detailed low level design/pseudocode ready before any code is written for this project. You will have 3 source code files at a minimum. All of the Administrator functionality must be written in administrator.c source file. All of the Customer functionality must be written in customer.c file. You will also create a main.c file that will be responsible for serving the menu for the Customer and the Administrator. You will compile and build the “banksystem” object. You will run your program by entering the command line on the Linux/Unix system as below: “banksystem CustomerData.txt” Thus, you will also design the main function with argc and argv[] as parameters. Exception Handling:You must implement all possible exception handling that is needed to ensure that the program does not crash on invalid inputs. You must also ensure that the bank does not go into a loss because you allow customer to withdraw an amount greater than the balance.

Explanation / Answer


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>

struct data{
  
   char first[8], last[8], city[10], state[2], phone[17], acc_no[5];
   char pass[6];
   float bal;
};

void create_cust(int i){
  
   struct data dt[10];
  
   printf(" Enter customer first name : ");
   scanf("%s",dt[i].first);
      
   printf(" Enter customer last name : ");
   scanf("%s",dt[i].last);
      
   printf(" Enter the city : ");
   scanf("%s",dt[i].city);  
  
   printf(" Enter state : ");
   scanf("%s",dt[i].state);
      
   printf(" Enter phone number : ");
   scanf("%s",dt[i].phone);
      
   printf(" Enter customer account number : ");
   scanf("%s",dt[i].acc_no);
  
   printf(" Enter customer account password : ");
   scanf("%s",dt[i].pass);
  
   printf(" Enter the balance amount : ");
   scanf("%f",&dt[i].bal);
  
FILE *fp;

fp = fopen("CustomerData.txt","a");

fprintf(fp," %s %s %s %s %s %s %s %f",dt[i].first,dt[i].last,dt[i].city,dt[i].state,dt[i].phone,dt[i].acc_no,dt[i].pass,dt[i].bal);
fclose(fp);   
}

int main (){

struct data record[10];
  
int test_case;
char ch = 'y';
char login[20], pass[20],u_pass[20];

printf(" Welcome to Online Banking/ATM system");
printf(" ====================================");
printf(" Enter your Customer/Admin ID:");
scanf("%s",login);
printf(" Enter your Customer/Admin Password:");
scanf("%s",pass);
      
if((strcmp(login,"admin") == 0)&&(strcmp(pass,"admin"))==0){

   FILE * filehandle;
char lyne[121];

char *item;
int reccount = 0;
int k;

/* open file */
   filehandle = fopen("CustomerData.txt","r");
  
/* Read file line by line */
   while (fgets(lyne,120,filehandle) && (feof(filehandle)==0) ){
  
item = strtok(lyne," ");
strcpy(record[reccount].first,item);

item = strtok(NULL," ");
strcpy(record[reccount].last,item);

item = strtok(NULL," ");
strcpy(record[reccount].city,item);

item = strtok(NULL," ");
strcpy(record[reccount].state,item);
  
item = strtok(NULL," ");
strcpy(record[reccount].phone,item);
  
item = strtok(NULL," ");
strcpy(record[reccount].acc_no,item);

item = strtok(NULL," ");
strcpy(record[reccount].pass,item);
      
item = strtok(NULL," ");
record[reccount].bal = atoi(item);

reccount++;
}
   //This code gets displayed until option 8 is entered
   do{
   
   printf(" Welcome to Online Banking/ATM system");
    printf(" ====================================");
printf(" --------------------------");  
   printf(" Administrator Menu");
printf(" --------------------------");  

   printf(" 1) Create Customer account");
   printf(" 2) Change Password 3) View Customer Info");
   printf(" 4) Change Customer Info 5) Delete Customer account");
   printf(" 6) Show Top 5 accounts 7) Show customer accounts alphabetically");
   printf(" 8) Exit");
   printf(" Enter your choice : ");
   scanf("%d",&test_case);  
  
   //Necessary operations can be carried out according to user options
   switch (test_case){

       case 1 : create_cust(reccount);
               break;

       case 2 :
           break;

       case 3 :
           break;

       case 4 :
               break;
  
       case 5 :
               break;

       case 6 :
           break;

       case 7 :
               break;
  
       case 8 : exit(0);

       default :
       printf(" Invalid choice. Please try again!");
       ch = 'y';
           break;
   } // of switch
}while(ch == 'y');
  
    /* Close file */
   fclose(filehandle);
}
else{
    printf(" Invalid login credentials");
}
} // of main

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote