SRL Archive - C#/Visual Basic Help and Tutorials

Help with a project


doublex8

2011-11-03 16:55:10

So I'm working on my mid term for my intro to programming class. My teacher has admitted he doesn't know any of the things he is teaching very well. The book hasn't really explained the material I need to know to complete this. I'm just starting out learning this stuff so if anyone could help me it would be much appreciated.

That being said, what I'm trying to do is make an application where the user inputs a variable that is multiplied by each element in a one-dimensional array(8 elements) and then displays each elements individual total and add those totals up for a grand total. The part I am stuck on is multiplying the variable by each element in the array. Everything else I feel like I can figure out. Would anyone be willing to lend me some of their knowledge?

Wyn

2011-11-03 17:11:04

Complain to your principal that he's an idiot.

Kyle Undefined

2011-11-03 17:15:50

Here is a simple code example that should help you get started off. Let me know if you need help.


Sub Main()
Dim arrList As New ArrayList

arrList.Add(1)
arrList.Add(2)
...
arrList.Add(8)

MultiplyValue(arrList)
End Sub

Private Sub MultiplyValue(ByVal list As ArrayList)
Dim num As Integer

For Each num In list
Console.WriteLine(num * CInt(Me.txtInputValue.Text))
Next
End Sub

doublex8

2011-11-03 18:43:27

From: Camo Developer
Here is a simple code example that should help you get started off. Let me know if you need help.


Sub Main()
Dim arrList As New ArrayList

arrList.Add(1)
arrList.Add(2)
...
arrList.Add(8)

MultiplyValue(arrList)
End Sub

Private Sub MultiplyValue(ByVal list As ArrayList)
Dim num As Integer

For Each num In list
Console.WriteLine(num * CInt(Me.txtInputValue.Text))
Next
End Sub


If there is anyway you can message me on MSN or Skype that would be super helpful. In the mean time I'll mess around with what you gave me and see if I can make it work

Kyle Undefined

2011-11-03 19:20:01

I don't have any chat programs on this computer and really don't feel like downloading some. If you could hop on IRC, I'd be more than happy to help.

doublex8

2011-11-03 20:16:30

I'll download an irc program now. Which channel are you in?

Wyn

2011-11-03 20:23:28

From: doublex8
I'll download an irc program now. Which channel are you in?


#srl on Rizon network.