Answer to Question #210013 in C++ for ASAP

Question #210013

Topic: Files and Streams


Codes discussed will be posted here. Write your conclusion on the File stream discussion. 


Filename: "Ch5_AccountBalance.cpp"


Given problem and code: Please use the link below

-->>https://drive.google.com/file/d/1tDK28GtTpqbQ_sSKVkpdTQFJQz3gtlcB/view?usp=sharing


*Note: Need the proper codes

*Note need proper codes and conclusion on how its done and about the results. And please give the proper solution and explanation.

Note: Place your conclusion on why did it turn out like that and give your reasons why the results turned like that, one paragraph will do for the explanation and conclusion.


1
Expert's answer
2021-06-27T14:16:18-0400
#include <fstream>
#include <iostream>
using namespace std;
  
int main ()
{
    char data[100];
  
    // opening a file in write mode.
    ofstream myfile;
    myfile.open("E:\\message.txt");
  
    cout << "Writing to the file" << endl;
    cout << "Enter your name: ";
    cin.getline(data, 100);
  
    myfile << data << endl;
  
    cout << "Enter your age: "; cin >> data;
    cin.ignore();
  
    myfile << data << endl;
  
    // close the opened file.
    myfile.close();
  
   // opening a file in read mode.
   ifstream infile;
   infile.open("E:\\message.txt");
  
   cout << "Reading from a file" << endl; infile >> data;
  
   cout << data << endl; infile >> data;
   cout << data << endl;
  
   infile.close();
    
   return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

Assignment Expert
28.06.21, 14:26

Dear ASAP , if you have serious assignment that requires large amount 

of work and hence cannot be done for free you can submit it as assignment and our 

experts will surely assist you.



ASAP
28.06.21, 03:41

I said give me a conclusion and a solution why is there another code which is not related to the code I sent!!!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS