1.2 | lastline.c This writes the last line of input given. This could potentially be an empty string. program Test case Еaгреcted Output test1 mondays\n asdfqwerty test2 test3 1.3 | longestline.c This...


Create the following programs in
C++. Each program should be reading from a file (i.e., test1.txt, test2.txt, test3.txt) and then outputting the following to the screen.Note: No parameters in the main function


Program 1: last line of the file


Program 2: size of the longest line of the file


1.2 | lastline.c<br>This<br>writes the last line of input given. This could potentially be an empty string.<br>program<br>Test case<br>Еaгреcted Output<br>test1<br>mondays\n<br>asdfqwerty<br>test2<br>test3<br>1.3 | longestline.c<br>This program should write out the length of the longest line in the input (not including the newline characters which<br>delimit a line). Please do print a newline character after printing the length.<br>Test case<br>Еaгреcted Output<br>7\n<br>7\n<br>10\n<br>test1<br>test2<br>test3<br>Contents of the Test Cases:<br>test1<br>this is<br>a<br>test<br>mondays<br>[intended blank after mondays – END OF FILE]<br>test2<br>this is<br>a<br>test<br>mondays<br>*[no blank after mondays – END OF FILE]<br>test3<br>а<br>asdfqwerty<br>

Extracted text: 1.2 | lastline.c This writes the last line of input given. This could potentially be an empty string. program Test case Еaгреcted Output test1 mondays\n asdfqwerty test2 test3 1.3 | longestline.c This program should write out the length of the longest line in the input (not including the newline characters which delimit a line). Please do print a newline character after printing the length. Test case Еaгреcted Output 7\n 7\n 10\n test1 test2 test3 Contents of the Test Cases: test1 this is a test mondays [intended blank after mondays – END OF FILE] test2 this is a test mondays *[no blank after mondays – END OF FILE] test3 а asdfqwerty

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here