Question Confusing Array

cieloica

New member
Joined
Apr 24, 2011
Messages
1
Programming Experience
Beginner
I'm a newbie in .NET and I started with VB.NET 2005 (Framework 3.5).
I make an application for my store.
Here's a piece of code :

VB.NET:
        Dim arrStore() As String = {"A", "B", "C"}
        Dim arrSupply() As Integer = {31, 64, 15}
        Dim arrSold() As Integer = {69, 36, 85}

        For i As Integer = 0 To arrStore.Length - 1
            txtStore.Text = txtStore.Text & _
                            "Store " & arrStore(i) & vbCrLf & _
                            "Supply : " & arrSupply(i) & vbCrLf & _
                            "Sold : " & arrSold(i) & vbCrLf & vbCrLf
        Next

Output :
Store A
Supply : 31
Sold : 69

Store B
Supply : 64
Sold : 36

Store C
Supply : 15
Sold : 85

Problem :
Every week I supply 100 items (4 different types) for each store. (e.g Shirt, T-Shirt, Pants and Short Pants), 25 items for each type.
What I want to do is to make an output with more details, and yet I can't find a code to give me the result. :confused:

Store A
Shirt
Supply : 9
Sold : 11
T-Shirt
Supply : 12
Sold : 8
Pants
Supply : 10
Sold : 10

and so on....

Could anyone help me with my array problem? Any help would be much appreciate. Thank you. :rolleyes:
 

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,742
Location
Sydney, Australia
Programming Experience
10+
I'm a newbie in .NET and I started with VB.NET 2005 (Framework 3.5).
No you didn't. VB 2005 supports .NET 2.0 only. VB 2008 supports .NET 2.0, 3.0 and 3.5 and VB 2010 supports those plus .NET 4.0.

You're not supposed to find the code. This is obviously homework of some sort so you're supposed to write the code yourself. You currently have one array for stock level and one for items sold. If you want to use arrays with multiple types of stock then you need multiple arrays: two for each stock type.
 
Top Bottom