Question
C++ Help: I have posted what I have done so far with my code but I don't know how to make the table show up
C++ Help:
I have posted what I have done so far with my code but I don't know how to make the table show up and I cant get the correct output.
My Code so far:
#include
#include
#include
#include
using namespace std;
int main()
{
ofstream outAccountFile("accounts.txt", ios::out); // ofstream constructor opens file
// exit program if unable to create file
if (!outAccountFile) // overloaded ! operator
{
cerr
exit(EXIT_FAILURE);
}
cout
cout
cout
cout
int account_type;
int acccount_id;
string name;
double balance;
// read account type, account ID, name, initial balance, and duration
while (cin >> account_type >> acccount_id >> name >> balance) // user input
{
outAccountFile
cout
}
}
(read/write to a sequential file practice) In this lab exercise, you will write bank accounts info into a sequential file, and read/print bank accounts info from the sequential file Get the accounts information from users' inputs including Account type, account id, account name, balance, and duration. Read from the sequential file, and print out the account information in a table format. Use enum to define, 1 - SAVING ACCOUNT 2 - CHECKING ACCOUNT 3 - CDACCOUNT . Sample output Enter the account type 1 Saving Account, 2 - Checking Account, 3 CD Account), account ID, name, initial balance ($) and duration (months, for Saving and Checking Account): Enter end-of-file to end input. 1 1001 GreenArrow 2000e ?2 1882 RedFlash 1508 3 1003 Snowwhite 3000 15 ?2 1004 SuperMan 2000 1 1005 SuperGirl 5000 e 2 1806 CaptainHook 1000 e 3 1007 RobinHood 6000 12 3 1008 PeterPan 6666 6 Account ID Account Name Balance($) Duration CHECKING_ACCOUNT RedFlash SuperGirl 1006 CaptainHook PeterPan Program ended with exit codeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started