mcarterbrown.com  

Plugged in Online Gaming, and Technology

Reply
 
Thread Tools
Old 02-12-2013, 11:01 PM   #1 (permalink)
Post Whore
 
2SIC4U's Avatar
 
Join Date: Jan 2008
Location: South Carolina
Send a message via AIM to 2SIC4U

Any Visual Basic Programmers?? I need help!!

'Hey guys, I was wondering if there were any coders that are members on this site. I'm in an introductory Visual Basic class and there is a part of my lab that is confusing me.

Here is the part of the lab that's confusing:
"ReadData button: First it should clear ListBox1. Then it should open a file named data.txt which you can assume has 3 lines in it. Each line is assume to have a name, a space, and then a number on it. Place just the names in the ListBox in backwards order and place the sum of the 3 numbers from the file into the textbox."

I made the data.txt file. I just dont know how to go about placing just the names in the listbox, let alone backwards, and then placing the sum in there too.

Then I have another button to do:
"ReadDataFormat: This does the mostly the same work as the ReadData button, but its output is formatted. First it should clear ListBox1. Then it should open a file named data.txt which you can assume has 3 lines in it. Each line is assume to have a item name, a space, and then a number on it. Place into ListBox1 3 lines each of the form
"itemname" costs "amount"
where itemname and amount are values from the text file. You are required to use a format string and the String.Format function. item names can be as big as 15 characters and amounts are fractional numbers that could be as large as 9999.99. The numbers should be formatted as currency."

So yea... help lol
__________________
PBNation Feedback - Pos 79 - Neg 0
http://www.pbnation.com/feedback.php?u=324508
2SIC4U is offline   Reply With Quote
Old 02-13-2013, 02:08 PM   #2 (permalink)
Active Member
 
Join Date: Mar 2008

did you figure it out?

its going to be something like
clear listbox1
read file
while file not eof
read line into string
split string on space
put the name into an array or list
total = total + number
end

reorder the array/list

add to listbox1

Last edited by temps; 02-13-2013 at 02:11 PM.
temps is offline   Reply With Quote
Reply

  mcarterbrown.com » General » Off-Topic » Plugged in

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -4. The time now is 01:37 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO
© MCB Network LLC