Explore BrainMass
Share

Explore BrainMass

    Test line in C

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    TestLineNumbering that accepts one command-line argument, the name of the file. Your code should verify that a single command-line argument was specified.
    Declare a variable that holds a File object which is initialized from the file named in the first command-line argument.
    Within a try-catch block, create:
    - a buffered, input stream reader based on the System.in stream (Standard input).
    - a print file writer based on the File reference.
    - a while loop that reads each line from the console input stream and prints the line out to the file prepended with the count of the line number.
    Close the I/O streams.

    © BrainMass Inc. brainmass.com October 10, 2019, 4:54 am ad1c9bdddf
    https://brainmass.com/computer-science/c-sharp/test-line-483279

    Solution Summary

    This solution provides a sample of the included programming assignment.

    $2.19