Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How we can code this

C#
The main method will:
Request the input file name.
Request the output file name.
Request the program "mode" (see below)
0 -- means the file(s) will be processed in character-by-character mode (see #2 below).
1 -- means the file(s) will be processed in line-by-line mode (see #3 below).
The character-by-character method will:
Open a simple text file.
Read the file and write it to output immediately, byte-by-byte, testing for the end of file marker.
Close the files.
Compute and display the wall-clock time (the "real-world" time) 
The line-by-line method will:
Open a simple text file (same file as 2 above) and an output file.
Read the file and write it to output immediately, line-by-line, testing for the end of file marker.
Close the files.
Compute and display the wall-clock time (the "real-world" time)
Run the program, use both modes. Compare the two results and explain the differences, if any. If none, explain why.


What I have tried:

C#
The main method will:
Request the input file name.
Request the output file name.
Request the program "mode" (see below)
0 -- means the file(s) will be processed in character-by-character mode (see #2 below).
1 -- means the file(s) will be processed in line-by-line mode (see #3 below).
The character-by-character method will:
Open a simple text file.
Read the file and write it to output immediately, byte-by-byte, testing for the end of file marker.
Close the files.
Compute and display the wall-clock time (the "real-world" time) 
The line-by-line method will:
Open a simple text file (same file as 2 above) and an output file.
Read the file and write it to output immediately, line-by-line, testing for the end of file marker.
Close the files.
Compute and display the wall-clock time (the "real-world" time)
Run the program, use both modes. Compare the two results and explain the differences, if any. If none, explain why.



My question is where do i put my time clock and second question how do i will open that file in my else block because its giving me compilation error.
Posted
Updated 26-Oct-16 11:32am
v3
Comments
[no name] 26-Oct-16 13:42pm    
How is this any different that the same vague "not working" not-a-question you asked previously about the same thing?

1 solution

Since you do not specify what is not working it is difficult to help. However, if you want to use the filenames that the user has provided as input you must start with removing the quotation marks around the variables names:

C#
inputStream = new FileReader(inputfile);
outputStream = new FileWriter(outputfile);


Then you of course must add code for the n=1 case.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900