Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help: Homework 1.1 & 1.3

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
branmask



Joined: Thu Feb 18, 2010 1:19 am
Posts: 14

PostPosted: Tue Mar 02, 2010 7:08 am    Post subject: Need help: Homework 1.1 & 1.3 Reply with quote

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
View user's profile Send private message
Pidster



Joined: Tue Mar 16, 2010 4:59 pm
Posts: 1

PostPosted: Tue Mar 16, 2010 5:26 pm    Post subject: Reply with quote

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 user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast