C++ File Operation Challenge
Write my research paper
Shall I compare thee to a summer’s day?
Thou art more lovely and more temperate:
Rough winds do shake the darling buds of May,
And summer’s lease hath all too short a date:
Sometime too hot the eye of heaven shines,
And often is his gold complexion dimm’d;
And every fair from fair sometime declines,
By chance, or nature’s changing course, untrimm’d;
But thy eternal summer shall not fade
Nor lose possession of that fair thou ow’st;
Nor shall Death brag thou wander’st in his shade,
When in eternal lines to time thou grow’st;
So long as men can breathe or eyes can see,
So long lives this, and this gives life to thee.2. Add the following code to your Main():int main() { std::ifstream in_file {“../poem.txt”}; std::ofstream out_file{“../poem_out.txt”}; if (!in_file) { std::cerr << "Error opening input file" << std::endl; return 1; } if (!out_file) { std::cerr << "Error opening output file" << std::endl; return 1; } std::string line{}; while (std::getline(in_file, line)) out_file << line << std::endl; std::cout << "File copied" << std::endl; in_file.close(); out_file.close(); return 0;}3. Analyze the code, fully understand it, and Change the code to manipulate the file and add a line number to the beginning of each line.your output should look like this:1 Shall I compare thee to a summer's day?
2 Thou art more lovely and more temperate:
3 Rough winds do shake the darling buds of May,
4 And summer's lease hath all too short a date:
5 Sometime too hot the eye of heaven shines,
6 And often is his gold complexion dimm'd;
7 And every fair from fair sometime declines,
8 By chance, or nature's changing course, untrimm'd;
9 But thy eternal summer shall not fade
10 Nor lose possession of that fair thou ow'st;
11 Nor shall Death brag thou wander'st in his shade,
12 When in eternal lines to time thou grow'st;
13 So long as men can breathe or eyes can see,
14 So long lives this, and this gives life to thee.4. Copy your code and paste it here (text input).Purchase the answer to view itPurchase the answer to view it
This is property of essayprince.com. We provide the best Online writing service to our students. Log in today to get access to notch papers
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.