IST 256 Lab 22 ? April 14, 2008 1. Writing a Two-dimensional Array Program that computes Row and Column Averages Use the new process for opening a Visual Studio project: a. Go to the C: drive and make a folder at the top level with your name or userid, something like: C:\njmccrac b. Open Visual Studio and go to create a new project/solution When this Dialog box opens, i. name: pick a name for the project ? something like Averages ii. location: browse to the folder that you just made on the C: drive c. In this first part, create the form and use the program from last week that reads numbers from a file into a two-dimensional array. Making the form: make two Labels and two Buttons on the form that looks something like: |__Read Numbers From File ?samples.txt?__| Row Averages (label) Row Averages (label) |_Close_| d. Copy the data file ?samples.txt? from the web page from last week and save it in the C:\name\Averages\bin\Debug part of the project folder or just in your C: drive folder. e. Click on the two buttons to write the program. For the main button, copy the button procedure from the program given last week in class, on the web page labeled ?Two-D Array Program?. This program computed the total of all the numbers, which we are no longer going to do, so you can remove the variable total from the code. What remains is a While loop (with an inner For loop) that reads the numbers from the file into a two-dimensional array called ?numbers? f. Now after the While loop that reads numbers into the array, we are going to add code that processes the elements of the array in two different ways. The first is to compute the average of every row. After the While loop, add the code as discussed in class that will compute the average of each row and display it in Label1. (Note that all of the code is going into one button procedure.) This code will have two For loops that iterates over every row and every column. Test your program. g. Now after the code that computes the Row averages, compute and display the column averages in Label2 as discussed in class and test your program. ***************** At the end of lab ******************** Go to the C: drive where you put your folder with your name. Copy and paste this entire folder to the H: drive under your IST256 projects. *************** Don?t forget to save your work! **************** nancy Microsoft Word - Lab22.4.14.08.doc
Want to see the other 2 page(s) in Lab22.4.14.08.pdf?JOIN TODAY FOR FREE!