Lab Exercise 1 (Part 2) 1. Write a C++ program which the getLine() function to reads...
Fantastic news! We've Found the answer you've been seeking!
Question:
![image text in transcribed](https://s3.amazonaws.com/si.experts.images/answers/2024/05/664c8dea91fee_098664c8dea2e074.jpg)
![image text in transcribed](https://s3.amazonaws.com/si.experts.images/answers/2024/05/664c8deb3de9c_098664c8deac9b24.jpg)
Transcribed Image Text:
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 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
Expert Answer:
Posted Date:
Students also viewed these programming questions
-
Write inequalities to describe the set. The slab bounded by the planes z = 0 and z = 1
-
Choi and Levich found that investors cope with accounting principles differences in two fundamentally different ways. What are these coping mechanisms and which of the two do you favor?
-
A baseball is thrown with an initial velocity of (10i & 15j) m/s. When it reaches the top of its trajectory, what are? (a) Its velocity and (b) Its acceleration? Neglect the effect of air resistance.
-
Convert the following to expressions with no negative exponent: 1. \(12^{-3} \times 7^{5}\) 2. \(c^{-7} \times 5^{3}\)
-
Mann Hardware has four employees who are paid on an hourly basis plus time-and-a-half for all hours worked in excess of 40 a week. Payroll data for the week ended March 15, 2014, are presented below....
-
(1) Matta Industries Ltd. is a manufacturer with a December 31 year-end. On January 1, 2020, the undepreciated capital cost for Class 10.1 was $17,850. The Class 10.1 car was purchased in 2017 fo...
-
Identify this clause: "In the event that delivery of your order is delayed, XCo agrees to pay you $1000 for each day following the delivery date that your order is overdue". a. Limitation of...
-
On July 1, Davidson Corporation had the following capital structure: Common stock ($4 par value) Additional paid-in capital Retained earnings Treasury stock Required: $ 678,000 960,000 840,000...
-
Which point on the graph y=4x are closest to the point (0, 2)? (Hint: consider the distance formula between two points)
-
Rabbits and Sheep live in the same area. Rabbits have a net birth rate of 21 rabbits per one rabbit per year while sheep have a net birth rate of 4 sheep per one sheep per year. The competition for...
-
Rich Cole Control Devices, Inc., produces custom-built relay devices for auto makers. The most recent project undertaken by Cole requires 12 different activities. Cole's managers would like to...
-
Find the area under the curve y = 1x-2 from 9 to at and evaluate it for t=10, t = 100. Then find the total area under this curve for x 9. (a) t = 10 1 90 0 (b) t=100 91 900 (c) Total area 101 900
-
Analyze the assigned acts using the following guidance. When entering your analysis comments on the Discussion Board, consider the following format to present your investigation 1. Name and date of...
-
Evaluate each logarithm to four decimal places. log 0.257
-
If it is 4:00 now, what time was it 67 hours ago?
-
If it's \(3: 00\), what time will it be in 89 hours?
-
Suppose it is 3:00, and you decide to check your email every 5 hours. What time will it be when you check your email the ninth time?
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App