[HELP] C# Homework 2. LearnVisualStudio [HELP] - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19) +---- Thread: [HELP] C# Homework 2. LearnVisualStudio [HELP] (/showthread.php?tid=13244) |
[HELP] C# Homework 2. LearnVisualStudio [HELP] - -paradox- - 10-28-2010 Alright so long story short I am extremely new to this and refuse to cheat so throw hints at me not answers. This should be super easy, here is the assignment. I have a .txt file that is named "DecodeThis.txt" It's simply a .txt with the words backwards. So I know I need to read this file and then flip it using Array.Reverse. I don't know how and when to apply this though. So here is what I have so far. Spoiler (Click to View) I just don't know how to apply the arrays.. Spoiler (Click to View) Not sure if that's right and I'm not sure where to put it.. Any tips that aren't answers? --EDIT-- Alright here is the closest I've gotten but it's still wrong. Spoiler (Click to View) RE: [HELP] C# Homework 2. LearnVisualStudio [HELP] - Disease - 10-28-2010 (10-28-2010, 12:04 AM)-paradox- Wrote: --EDIT-- You need to take this one step at a time. Everything is going to take place in your while () loop. And you aren't going to be converting the stream to a char array, but rather the output from the stream (look at your current while loop). Also, you'll want to revise the conditional of your while loop. StreamReader objects have an EndOfStream property, which returns a boolean (true if it's at the end of the stream). So if you make your while loop's invariant "while EndOfStream is not true", you won't need to worry about reading in a line that doesn't exist. RE: [HELP] C# Homework 2. LearnVisualStudio [HELP] - -paradox- - 10-28-2010 Spoiler (Click to View) Well I got this part of it. Thanks for replying by the way, I really appreciate it. I have a feeling I'll need a lot of help in the future as well. I'm going to go through lesson two and hopefully figure this out first try next time. I'll implement the making a new .txt the next time around. RE: [HELP] C# Homework 2. LearnVisualStudio [HELP] - -paradox- - 10-28-2010 I need help with this again.. I'm not sure what's missing or what is wrong but when I run it, it creates the .txt just fine but doesn't actually put in the decrypted message. I'm aware there may be other messages but this is what I've learned so far and this is what I'm required to use. Spoiler (Click to View) RE: [HELP] C# Homework 2. LearnVisualStudio [HELP] - Disease - 10-29-2010 (10-28-2010, 06:40 PM)-paradox- Wrote: I need help with this again.. I'm not sure what's missing or what is wrong but when I run it, it creates the .txt just fine but doesn't actually put in the decrypted message. I'm aware there may be other messages but this is what I've learned so far and this is what I'm required to use. What you have there should work. Are you looking for it in the correct spot? The file should be created inside the project folder - bin - Debug directory. Alternatively you could force it to save the file to the desktop. Code: StreamWriter myWriter = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\decoded.txt"); |