Need help with assignment (File Input and Ouput, Encoder)
Quote:
Create an encode/decode program. This program will have two methods (or two classes) that use the FileWriter/FileReader and BufferedWriter/BufferedReader. The first class/method will write an encoded message to an output file call “codedmessage.txt”, e.g., you could shift the letters of the alphabet by one [hello=ifmmp]. The encoded massage should be a least ONE SENTENCE in length (minimum of 50 characters). The second class/method will read in the contents of the encode file and decode the encoded message.
Proposed marking scheme:
• Use of FileWriter and BufferedWriter to output file [10 marks]
• Simple encryption applied to text before writing [10 marks]
• Read in file using FileReader and BufferedReader [10 marks]
• Use of methods and/or separate classes for I/O [10 marks]
This is our question, only problem is I have been away on holidays the last two weeks and got caught behind on my java and I havn't even started on these file writer/filereader imports and don't really know what I'm doing here, tried reading the college notes but I got even more confused, if anyone can explain how I can get started on this would be very appreciated
Re: Need help with assignment (File Input and Ouput, Encoder)
It looks like there are two things you need to do:
Write and read a file.
encode and decode a String
Work on each part separately and then merge the code.
What questions or problems are you having with these?
Re: Need help with assignment (File Input and Ouput, Encoder)
As a helpful reference to you, here are some links to the APIs your project mentions:
FileWriter
BufferedWriter
FileReader
BufferedReader
And just in case, here is the String API: String (Java Platform SE 6)