Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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 code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago