Question: I need this program in C++. I have coded out my best attempt at it but I am not sure I have done it correctly.
I need this program in C++. I have coded out my best attempt at it but I am not sure I have done it correctly. I couldn't figure out how to dynamically create the structure. Also, I'm sure there is a better way to validate that the account number is 5 digits long. I couldn't find another way to break out of the while loop without using a break, I would like to maybe see if there is a more efficient way for that.
Here is the details required of the program:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Develop an application using structures for a customer that will determine if he/she has exceeded his/her checking account balance. For each customer, the following facts are available: a. Name b. Address c. Account number (Five digits only, i.e. test for this) d. Balance at the beginning of the month e. Total of all checks written by this customer this month Loop until customer is through entering checks. f. Total of all deposits credited to this customer's account this month. Loop until customer is through entering deposits. Dynamically create the structure. The program should input each of these facts from input dialogs, store in a structure, calculate the new balance, display the new balance and debit the account $15 if overdrawn. Also, if overdrawn, tell the customer the additional $15 fee has been accessed and what the balance would be with this fee included. Make sure to output the contents of the structure.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Here is the structure I have in the .h file
#ifndef CUSTOMER_H #define CUSTOMER_H struct Customer { string name; // Customers Name string address; // Customers address int account; // Five digit account number float balance; // Balance at the beginning of the month float cTotal[]; // Total of all checks written by customer this month float dTotal[]; //Total of all deposits credited to the account this month };
#endif /* CUSTOMER_H */
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
And here is the main program I have so far:
#include
#include "Customer.h"
int main( ) {
cout<<"Bank Account(Problem 1)"< return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
