| View previous topic :: View next topic |
| Author |
Message |
branmask
Joined: Thu Feb 18, 2010 1:19 am Posts: 14
|
Posted: Tue Mar 02, 2010 7:08 am Post subject: Need help: Homework 1.1 & 1.3 |
|
|
Hello all,
I've finished Project 1 except for the homework 1&3. On 1 I'm having trouble figuring out how to get the total of items to print. also, should it be under an "else if" of it's own or just under the last "else"? On 3 I think I should use the args==clear, File.Delete, & AppendAllText, but am not sure what else I need. Any pointers/suggestions would be most appreciated.
Thanks all |
|
| Back to top |
|
 |
Pidster
Joined: Tue Mar 16, 2010 4:59 pm Posts: 1
|
Posted: Tue Mar 16, 2010 5:26 pm Post subject: |
|
|
this is how i added in the first part
else{
var contents=File.ReadAllLines("todo.txt");
var counter=1;
Console.WriteLine("number of items :" +contents.Length);
foreach(var items in contents){
Console.WriteLine(counter+":"+items);
counter++;}
and the third part i guess i used extras not show in tutorial
else if (args[0]=="clear"){File.Delete("todo.txt");
File.Create("todo.txt");}
hope this helps, im still working on second part... |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|