Question: Lab Exercise 1 (Part 2) 1. Write a C++ program which the getLine() function to reads a file and display it on the screen.


Lab Exercise 1 (Part 2) 1. Write a C++ program which the getLine() function to reads a file and display it on the screen. Sample input file: This is a Data Structure class for Sem 1 2020/2021 In this program we learn how to use getLine() function This function is faster than using the get() function 2. Modify the program, print all the input enter by the user by applying the header file and implementation file concept. Create your own file for main.cpp and account.cpp. Expected output: Creating bank account Enter first name: adelia Enter surname name: hasraf Enter opening balance: 50000 hasraf, adelia balance: 50000 Input Account.h main.cpp Account.h Account.cpp 1 #ifndef _ACCOUNT_H_ 2 #define _ACCOUNT_H_ 3 4 #include 5 6. class Account { 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 }; public: Account(); Account(std::string fname, std::string sname, double balance); std::string getName(); std::string getFirstName(); std::string getSurname(); double getBalance(); void lodge(double); double withdraw(double); void printDetails(); private: double balance; std::string fname; std::string sname; 25 26 #endif
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
