/* This program demonstrates the use of structures. */ #include using namespace std; struct WellsCargo_account { double balance ; double interest_rate; int term ; } ; void get_data(WellsCargo_account& customer_account) ; int main() { WellsCargo_account Natasha_Sharma; get_data(Natasha_Sharma); double rate_frac, interest ; rate_frac = Natasha_Sharma.interest_rate/ 100.0 ; interest = Natasha_Sharma.balance* rate_frac*(Natasha_Sharma.term/12.0); //notice the use of the 12.0 to guarantee the return of a type double! Natasha_Sharma.balance = Natasha_Sharma.balance + interest ;//notice how the formula has been broken down into chunks to avoid mistakes! cout << " When your account matures in " /*Notice the space provided before the closing quotes "*/ << Natasha_Sharma.term <<" months, \n" << "the balance will be = " << Natasha_Sharma.balance << endl; return 0; } void get_data(WellsCargo_account& customer_account) { cout << "Enter the account balance: "; cin >> customer_account.balance ; cout << "Enter the interest rate: "; cin >> customer_account.interest_rate ; cout << "Enter the number of months until maturity \n (must be 12 or fewer): "; cin >> customer_account.term ; } /* CLASS TASK: Write the program of a structure type call the type employee record. This record should consisitng of an employee's 1. wage rate 2.accrued vacation time (in terms of days) 3.status (either hourly or salaried). Represent the status as one of the two char values 'H' and 'S'. */