Question: PLEASE HELP ASAP C++ In the following program read the account number , account type (' c ' for Credit, ' d ' for Debit),

PLEASE HELP ASAP C++

In the following program read the account number, account type ('c' for Credit, 'd' for Debit), and deposit amount of a Customer from the console, and store the information in objects of type Customer.

Implement the global function read() to read customer information and store it in the Customer object and then implement another global function called display() to display the information stored in the Customer object.

Looking at the code in main(), note that the functions read() and display() receive Customer pointers as arguments.

Function definitions and statements in the main function are missing, which are marked byTODO.

Please complete the missing parts:

#include

#define NO_CUSTOMERS 3

using namespace std;

struct Customer {

int acc_no; // account number

char acc_type; // account type

double dep_amt; // deposit amount

};

// TODO-1: write implementation of function read()

// TODO-2: write implementation of function display()

int main()

{

struct Customer* cst;

// TODO-3: allocate memory pointed by cst to store total NO_CUSTOMERS objects

for (int i = 0; i < NO_CUSTOMERS; i++) {

read(&cst[i]);

}

for (int i = 0; i < NO_CUSTOMERS; i++) {

display(&cst[i]);

}

// TODO-4: free memory allocated

}

Input format:

Account no: 9999 Account type: c/d //get c for credit and d of debitDeposit amount: 999.99

Output format:

Account no: 99999Account type: Credit/Debit // print credit for c and debit for dDeposit amount: 999.99

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!