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

Write a complete Cprogram that functions as a bank account simulator. Be sure to

ID: 3778043 • Letter: W

Question

Write a complete Cprogram that functions as a bank account simulator. Be sure to be complete and thorough, keeping in mind all of the syntax details and program flow ideas we have discussed this semester. Please be sure to include comments in your program as mentioned in the grading rubric, and please remember to demonstrate your working code to your instructor before you submit this program for grading. Your program should accomplish the following objectives: When starting the program, it should ask the user for the starting balance of the account, the annual percentage rate (APR) of interest earned for the account, and the date the account created. This information should be recorded in the transaction log (discussed below) Once the account is set up, the program should present a user with a menu giving five possible options. You can decide how the user selects which option should be performed next, but your program should only accept valid inputs from the menu. The program should return to this menu repeatedly until the last option is selected. The five menu options are detailed next: o The user should be able to make a deposit to the account. Selecting this option should prompt the user to enter the amount of the deposit (make sure it is valid), which should then be added to the account balance. This should be recorded in the transaction lo The user should be able to make a withdrawal from the account. Selecting this option should prompt the user to enter the amount of the withdrawal (make sure it is valid) which should be subtracted from the account balance. This should be recorded in the transaction log. Do not allow the user to withdrawal more money than is in the account under any circumstances!!! You can decide exact ly how your program handles this. Does it refuse to do the transaction? Does it allow the user to pull out the current balance in the account, leaving a balance of zero? Up to you to decide.) o The user should be able to calculate interest earned on the account, using the formula provided below. Any interest earned should be deposited back into the account. This should be recorded in the transaction log. Only apply interest if the account balance starts out bigger than zero! Interest Balance x (APR as a decimal) o The user should be able to apply a fee to the account. Selecting this option should prompt the user for the amount of the fee (make sure it is valid), which should be subtracted from the account balance. This should be recorded in the transaction log. A negative account balance can result from this option! The user should be able to close the account. When this happens, ask the user for the date the account is being closed. The closing date and the closing balance should be written to the transaction log as well as a "Thank you for your business" message. At this time, the program should end. our program should create a transaction log of everything happening to the account from its creation to its end. Write this transaction log into an output file called "xactlog.txt" while your program is running. You are allowed some freedom in style and formatting with this log. but make sure to meet the minimum requirements for each transaction

Explanation / Answer

#include <stdio.h>
#include <string.h>
int main(void){
    float balance;
    printf("Balance: ");
    scanf("%f", &balance);
    float APR;
    printf("APR: ");
    scanf("%f", &APR);
    char date[10];
    printf("Date: ");
    scanf("%s", date);
    printf("Enter your choice to do the desired transaction ");
    printf("1. Deposit 2. Withdrawal 3. Calculate Interest Earned 4. Apply fee to account 5. close the account");
    int choice;
    scanf("%d", &choice);
    char tlog[] = "Transaction Log: ";
    while (choice!=5){
        if(choice==1){
            printf("Amount: ");
            float amount;
            scanf("%f", &amount);
            balance += amount;
            char am[20];
            ftoa(amount, am, 2);
            strcat(tlog, strcat(am, " deposited. "));
        }

        else if(choice==2){
            printf("Amount: ");
            float amount;
            scanf("%f", &amount);
            balance -= amount;
            char am[20];
            ftoa(amount, am, 2);
            strcat(tlog, strcat(am, " withdrawn. "));
        }

        else if(choice==3){
            float interest = balance * APR/100.0;
            char in[20];
            ftoa(interest, in, 2);
            strcat(tlog, srcat(in, " interest earned. "));
        }

        else if(choice==4){
            printf("Amount: ");
            float amount;
            scanf("%f", &amount);
            balance -= amount;
            char am[20];
            ftoa(amount, am, 4);
            strcat(tlog, strcat(am, " fee deducted. "));
        }
    }

    strcat(tlog, "Thank you for your business.");

}

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