Homework - Declare A Two Dimensional Array With 5 Rows And 3 Columns

Nov 2, 2010

I've been taking a class on it this semester and am starting to get very confused and behind. I've been pretty stuck on my hwk assignment for this week and was wondering if anyone could possibly hint at what I'm doing wrong or if I'm just completely way off. The whole rows and columns in arrays seems to be throwing me off now. Also, sorry if this is not the right place to post something like this I was not sure which section this fit under.

[Code]...

View 2 Replies


ADVERTISEMENT

Create An Interface Using Two-dimensional Array With 4 Rows, 5 Columns

Nov 3, 2011

I need to build an interface that allows the user to select a horse from a list. The horses are as follows: horse1, horse2, horse3 and horse4. The application should display the way the horse places with a 1 means the horse won, 2 indicates second place , 3 indicates third and 0 indicates the horse did not place. Application needs to display a summary of each horse's individual performance as well as the performances of the other horses. Table for keeping track of each horse is as follows:

5 races-how each placed
1 2 3 4 5
horse1 0 1 0 3 2

[Code]....

View 8 Replies

Declare A Two Dimensional Array Of Integers?

Feb 2, 2011

"declare a two dimensional array of integers named intgrades.it should have 30 rows and 10 columns

View 1 Replies

Write The Statements To Declare A Local One-dimensional Array Named IntNumbe?

Jun 23, 2010

Write the statements to declare a local one-dimensional array named intNumbers.The array should have 20 elements

B. Write the statement to store the value 5 in the second element contained in the
intNumbers array

C. Write the statement to declare a form-level one dimensional array named mstrProducts.
The array should have 10 elements.

D. Write the statement to store the string "Paper" in the third element contained in the mstrProducts array.

View 2 Replies

Declare An Array Of Mixed Type [e.g.] Column 1 As String, Columns 2 Through 5 As Integer?

Oct 18, 2010

1] Is there a way to declare an array of mixed type [e.g.] column 1 as string, columns 2 through 5 as integer.

2] Is �Dim myArray( ,5 ) as type� a valid statement and if so will it result in a 5 column array of unspecified length?

View 1 Replies

Sum Rows And Columns In MultiDimensional Array

Dec 12, 2010

I am trying to create a console application that computes the row and column sum and prints the elements with the resulting sums for each row and column.[code]My column sum code is currently showing the row sums.and the rowsum code is showing a continuous sum, rather than a sum for just that row.

View 4 Replies

Array - Form With Text Boxes In A 6x6 Square Pattern - Add The Rows And Columns ?

Nov 18, 2010

I made a form with text boxes in a 6x6 square pattern. It will do a streamreader from a text file a number that indicates the size of the array. Then fill in the boxes with the numbers of the array. Then it will calculate the rows and columns to see if they add up to a single answer. Then it will display to an output window if it is a magic square or not. Meaning if all rows and columns add up to a single number its magic. If they dont add up to the same number then its not magic. Then it will repeat this check and output from the information of the other arrays from the text file.

I know how to code for the streamreader and get it to add the rows and columns. Im not sure about what code I need so it can check the answer if its magic or not and repeat it till the end.

Here are the contents of my text file which it will read from.

CODE:

View 3 Replies

Perform Addition On Each Of The Rows And Columns And Diagonally Of The Array And Display The Results To The User?

May 23, 2012

The Random generator works fine. What I have a problem with is adding the rows and columns.

Array
0,0 0,1 0,2 = row total
1,0 1,1 1,2 = row total

[code]....

View 1 Replies

Database - Find Average Of A Specific Number Of Rows/columns In Datatable And Store To Array?

Jun 21, 2012

I am trying to program a noise reduction algorithm that works with a set of datapoints in a VB.NET DataTable after being helped with my other question. Basically, I want to take two integers, a coordinate value (yCoord for example) and a threshold smoothing value (NoiseThresh), and take the average of the values in the range of (yCoord - NoiseThresh, yCoord + NoiseThresh) and store that number into an array. I'd repeat that process for each column (in this example) and end up with a one-dimensional array of average values. My questions are:

1) Did anything I just say make any sense ;), and

2) Can anyone help me with the code? I've got very little experience working with databases.

[Code]...

View 1 Replies

VS 2008 Copy One Dimensional Array Into Two Dimensional Array?

Feb 17, 2010

I have a string containing many lines. Each line has many values separated by commas. Basically it's in CSV format. The number of lines is variable but the number of columns is always 7.

I can get each line into a one dimensional array using Split(Var, Chr(10)).

I'd like to make it a two dimensional array where the second dimension contains each comma separated value.

I've got

Dim VarArray1() As String = Split(VarText, Chr(10))
Dim VaryArray2(0 To VarArray1.Length - 1, 0 To 6) As String

Is there a quick way to get the contents of VarArray1 into VarArray2. I know I can do the following.

For Counter = 0 to VarArray1.Length - 1
Dim line as string = VarArray1(Counter)
Dim Values() as string = Split(line, ",")
For Counter2 = 0 to 6
VarArray2(Counter,Counter2) = Values(Counter2)
Next Counter2
Next Counter

But is there a quicker way to do it that doesn't require passing through each element of VarArray1 and then passing through each element of Values.

The eventual goal in all of this will be to find the highest value in the 3rd column (the arrays are strings at this point because not all columns are numeric). To do that once I get the values into VarArray2 I suspect I have to pass through each element VarArray2, i.e. VarArray2(Counter,2). Unless I can copy the whole third column into a SortedList?

View 4 Replies

Convert GridView Table To Html Table But Rows Should Be Columns And Columns Should Be Rows

Aug 18, 2011

I have Dataset ds filled up with values Until now I was displaying values in GridView. Now I want that all the rows should be columns and columns should be rows.I have 2 options: Either 1 I can directly convert grid to columns and display it, or 2 I can convert the GridView to html and then write loops to convert. I was trying the 2nd option but I cant figure out how I should do that.[code]With this code I am still getting same as GridView. Please help me for converting rows to columns and vice versa.

View 1 Replies

Operator '&' Is Not Defined For Types '1-dimensional Array Of Byte' And '1-dimensional Array Of Byte'.

Feb 26, 2012

I have 9 1-dimensional arrays of bytes and 1 of them is empty, I want to make the empty one equal to the others put together like you would a string:

Dim bla As String = "bla" & "bla" & "bla"
'now bla = "blablabla"
but instead:

[Code]......

View 9 Replies

1-dimensional Array Of String Cannot Be Converted To 2-dimensional Array Of String

Feb 9, 2010

I am having a problem understanding the following error message:

Value of type 1-dimensional array of string cannont be converted to 2-dimensional array of string because the array types have different numbers of dimensions This line seems to be causing the error:

New String((13) - 1) {}

I did a Google search on this but didnt come up with anything useful. I didnt even change the code.I just found this example online and copied/pasted it into a project that Im working on.

All code is listed below!

Calendar.aspx.vb
Imports System
Imports System.Data

[Code].....

View 4 Replies

Append String To Array And Cast To 1-Dimensional Array

Aug 25, 2010

I need to append STRINg to Array and cast it 1-dimensionalArray

Dim remoteFileNames(0)
As
String

[Code]....

Here "FtpRemoteDirectory" is a string and ftpFileNames() is the Array String which list the FileNames.

and remoteFileNames is 1-dimension array

View 1 Replies

Open A CSV File Update Some Rows, Columns, Delete Some Rows And Save It As Another CSV File?

Aug 25, 2011

I have a csv file. I need to open it, delete whole row on basis of a column value, Update few of the column values and save the file as .dat file. I am using VB.net 2010

View 1 Replies

RE: Creating A Dimensional Array & Sub Array

Jun 9, 2011

I developing a roster application (asp.net with VB + sql server) to let user input shift duty record, proposed screen as follows:for the database design, each staff will have one record per day.[code]I want to create a multi dimensional array to bind the gridview.Is that correct that I create a arraylist (for 7 days) and then a subarray for each day? How can I create a 7 dimensional array & sub array under this 7-D array in asp.net + VB ?

View 1 Replies

Two Dimensional Array In .NET?

Jan 23, 2009

How to redim a two dimenational array in VB.NET, when it reached it's upper limit,.Also want to preserve the data.

View 2 Replies

Does Not Display Any Rows And Columns

Jan 27, 2009

I have taken this part from a previous application that works. This does not display any thing in the grid when i watch it it does show that it got 1 row but in reality it does not display it

Private Sub btn_all_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_all.Click
Dim con3 As New SqlConnection("xxxx")

[Code].....

View 3 Replies

Print Rows And Columns?

Feb 14, 2010

I am stuck on how I go about using the nested for loops.Add code in the Draw button�s Click event to create the number of rows and columns selected, using the character selected Use nested For loops to create the rectangle of characters based on the user selections. The outer loop will control the number of rows. Use the value selected in the Rows combo to determine the stopping value of the outer loop. Use the value selected in the Columns combo to determine the stopping value of the inner loop, which controls the number of characters per line.

Public Class MainForm
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cb_Rows.Items.Add(1)
cb_Rows.Items.Add(2)

[code]....

View 6 Replies

2 Comboboxes And 2-Dimensional Array?

May 10, 2012

I've been working on a VB project where I use a 1st drop down list to select a movie category and then in the 2nd drop menu, movies from that category will be displayed. The movies are stored in a 2-dimensional array by category. I've been able to edit my array but I'm having problems with my .AddRange() function. What would I have to put in those parentheses for the list (for each category) to appear in my 2nd combobox when the category is selected?

[code]...

View 1 Replies

3D - Multi Dimensional Array ?

Aug 11, 2011

Ive got a jagged multi dimensional array, how to work out the length of a single row of the array so;

My array is ;

CODE:

And i wish how to find the length of this;

CODE:

View 4 Replies

DataGridView And 2 Dimensional Array

Apr 1, 2010

I declare 2-dimensional array at class level
Dim delItems(9, 9) As String
The array elements are then each set to "EMPTY". I create a new form in memory
Dim frm As New Form
I create a new DataGridView add columns to it and add it to the new form
Dim d As New DataGridView
frm.Controls.Add(d)

Now the problem.....this code give error when try to load contents of 2-D array into DGV:
For i As Integer = 0 To 9
d.Rows.Add()
For j As Integer = 0 To 9
d.Item(i, j).Value = delItems(i, j).ToString
Next
Next

Error is ArgumentOutOfRangeException (Index was out of range...)
When I check value of loop control variables, i = 0 and j = 1

View 4 Replies

Five Element And One Dimensional Array

Feb 23, 2010

For my programm I am supposed to store the minimum points in a five-element, one dimensional integer array name points. And I need to store the grades in a five-element, one dimensional string array named grades. These arrays should be parallel arrays. I am supposed to code the display grades button click event procedure so that it declares both arrays. It also should search the points array for the number of points entered by the user, and then display the corresponding grade from the grades array.

Here is my code:
Option Explicit On
Option Strict On
Option Infer Off
Public Class Grades
Private Sub exitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles exitButton.Click
[Code] .....

View 2 Replies

Get A Two Dimensional Array From String?

Dec 14, 2010

I want to convert a stringbuilder to a matrix.[code]...

View 3 Replies

Get One Dimension From A Bi-dimensional Array In .Net?

Feb 26, 2010

I have an application in VBA that gives to my VB.Net dll one bi-dimensional variant. It is a an array, in which every component is a another array containing two positions.

I want to get this two-position array. When I am using VBA I can access directly the data from each position by doing:dataArray(index, 0) or dataArray(index, 1)And when I want to get the two-position array I can use:

Dim posArray as variant
posArray = dataArray(index)

[Code]...

View 1 Replies

How To Pass One Dimensional Array To VC++ DLL

Jun 22, 2010

I have a VC++ DLL, which returns the sum of two long double values, passed as one dimensional array?l the right syntax to pass array to this dll from vb.net

currently, my code snippet is as follows: DllClass.vb
Imports System
Imports System.Collections.Generic

[code].....

View 1 Replies

Initializing A Two-dimensional Array

Nov 12, 2011

Here are the facts: Consider the following program. Sub Main()

[Code]....

Compiling the program in Visual Basic Express produces no errors. However, if the program is imported into the Excel Developer environment; I get the following error: Expected: end of statement with the equal sign highlighted. A side comment: About eight years ago, I wrote a Visual Basic simulation program to study financial trends. I found that version of Visual Basic user frendly! I find the 2010 version very difficult for doing simular projects.

View 2 Replies

Make A 2-dimensional Array?

Oct 10, 2009

i want to make a vb.net program that reads from a text file a movie, with the help of a Open Dialog (called openFD in my program) (we don't know how many movie we've got), the actors, the release date, the country, and the rating.

The text file look like this:

Movie1;Actor,Actor,Actor1;Date1;Country1;Rating1
Movie1;Actor,Actor,Actor1;Date2;Country2;Rating2
...

First question: How can I make a 2-dimensional array? line(0,0) - Movie1, ... , line (1,5) - Rating2. Here Is my try, but it's not good:

Dim line As ArrayList = New ArrayList()
Dim itm As ArrayList = New ArrayList()
Dim i As Integer = 0

[code]....

And here is the code for the Delete Button. It deletes a movie from the listbox, but the details of the deleted movie remains for the next one, I must delete the details for the deleted movie, too.

ListBox1.Items.Remove(ListBox1.SelectedItem.ToString)

View 7 Replies

One Dimensional Array Application

Mar 7, 2009

i'm extremely confused. my professor gave us this as the FIRST problem to do in this intro to VB class...on page 380 of our text. it is due today and i have been up all night trying to figure out where to even start. i'm so frustrated. could someone please help me and steer me in the right direction? use a one dimensional array to solve the following problem: a company pays its salespeople on a commission basis. the sales people receive $200/week, plus 9% of their gross sales for that week. for example, a salesperson who grosses $5,000 in sales in a week receives $200 plus 9% of $5,000, a total of $650. write an application (using an array of counters) that determines how many of the salespeople earned salaries in each of the following ranges (assuming that each salesperson's salary is truncated to an integer amount): $200-299, $300-399, $400-499, $500-599, $600-699, $700-799, $800-899, $900-999 and over $999.

Allow the user to eanter the sales for each employee in a TextBox. The user clicks the Calculate Button to calculate the person's salary. when the user is done entering this information, clicking the Show Totals Button displays how many of the salespeople earned salaries in each of the above ranges.

View 6 Replies

One-dimensional Array As An Integer?

Jul 7, 2011

I'm having trouble with this specific code and on arrays in general. This is what I am asked to do: "In this exercise, code an application that displays the number of students earning a specific score. Declare a 20-element, one-dimensional integer array named intScores with the following 20 numbers assigned to the array: (88, 72, 99, 20, 66, 95, 99, 100, 72, 88, 78, 45, 57, 89, 85, 78, 75, 88, 72, and 88). Code the procedure so that the user can enter a score from 0 to 100. Then the procedure should display using a message box the number of students who've earned that score."

First off, I do not know what I'm doing wrong with my array.. it says there's an error in line 31 saying "variable intSubscript hides a variable in an enclosing block" but I don't know what that means. And lastly, once that is sorted out, I don't know how to code a message box to appear saying how many students have received that score.

[Code]...

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved