Question
Writing a matrix in Visual Basic Studio and not in c ++
Q3/ Write VB function/program to find the mean ( average of a 5 X 5 matrix of integers.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Program:

Module Module1

Sub Main()
Dim matrix(5, 5) As Integer
Dim r, c As Integer
Dim sum As Integer
Dim mean As Double

Console.WriteLine("Enter 25 elements of the array (5 * 5): ")
For r = 0 To 4
For c = 0 To 4
matrix(r, c) = Convert.ToInt32(Console.ReadLine())
Next c
Next r

sum = 0

Console.WriteLine()
Console.WriteLine("Elements of matrix(5*5): ")
For r = 0 To 4
For c = 0 To 4
sum = sum + matrix(r, c)
Console.Write(matrix(r, c) & " ")
Next c
Console.WriteLine()
Next r

mean = Convert.ToDouble(sum / 25)

Console.WriteLine("Mean : " & mean)

Console.ReadKey()
End Sub

End Module

Output:

file:///c/users/user/documents/visual studio 2015/Projects/CalculateMean/Calculate Mean/bin/Debug/CalculateMean.EXE Enter 25file:///c/users/user/documents/visual studio 2015/Projects/CalculateMean/Calculate Mean/bin/Debug/CalculateMean.EXE Elementsर Quick Launch (Ctrl+Q) х Sign in e - P.OX - Module 1 - Main Da Calculate Mean - Microsoft Visual Studio File Edit View View

Add a comment
Know the answer?
Add Answer to:
Writing a matrix in Visual Basic Studio and not in c ++ Q3/ Write VB function/program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Visual Basic (VB) Code on Visual Studio Code a Visual Basic (VB) program that calculates the...

    Visual Basic (VB) Code on Visual Studio Code a Visual Basic (VB) program that calculates the final grade a school course. The program will ask the user to enter ten grades for assignments (each is out of 25), five grades for quizzes (each out of 30), a midterm grade out of 300, extra-credit final project points (out of 100), final test points (out of 300) The program will add all of the points you entered and show you a letter...

  • 1. Write a C programme by using visual Studio: a) Write a function with parameters that...

    1. Write a C programme by using visual Studio: a) Write a function with parameters that returen the largest of three integer arguments. So users could call your function (name: max3) to output the maximum of three input values. b) Make a function outside of the main routine. And in the main routine, please call this function and print the harmonic mean. The harmonic mean of two numbers is obtained by taking the inverses of the two numbers, averaging them,...

  • Must be done in C++ 2013 microsoft visual studio Write a program that creates a 4...

    Must be done in C++ 2013 microsoft visual studio Write a program that creates a 4 x 5 two-dimensional array. The program should use loops to populate the array using the rand, srand and time functions with random numbers between 10 and 60. After the values have populated the array, output the values of the array to the screen in something that looks like a 4 x 5 table.

  • In c++ visual studio Write a program that does the following: Reads the input data set...

    In c++ visual studio Write a program that does the following: Reads the input data set from file named "data.txt". Assume that the input file contains x and y values as shown in the sample to the right (the first number in each line is the x value). The number of data points in the input file is not known but assume that they will not exceed 100. Once it gets the data in two one-dimensional arrays (x and y),...

  • Write a c# program in Microsoft visual studio to determine if the following numbers are even...

    Write a c# program in Microsoft visual studio to determine if the following numbers are even or not. Create an app that will read integers from an input file name Number.txt that will consist of one integer. Determine which numbers are even and which are odd. Write the even numbers to a file named Even.txt and the odd numbers to a file named Odd.txt. Number.txt 20 39 45 12 31 62 10 11 21 73 14 42 55 86 109...

  • write a programming code for the following problem using Visual Basic Studio VB. Write a program that will allow the user to enter series of mumbers and will give some useful statistics about the mam...

    write a programming code for the following problem using Visual Basic Studio VB. Write a program that will allow the user to enter series of mumbers and will give some useful statistics about the mambers Enter Numbers Button Click-Allow the user to enter series of nambers using imput dialog boxes. Use a loop and add the numbers to the listBox as they are input.. Prompt the user to enter"x" to stop addang numbers. Compute Statistics Button Click-Compute the following statistics...

  • Please write below code in C++ using Visual Studio. Write program that uses a class template...

    Please write below code in C++ using Visual Studio. Write program that uses a class template to create a set of items. The program should: 1. add items to the set (there shouldn't be any duplicates) • Example: if your codes is adding three integers, 10, 5, 10, then your program will add only two values 10 and 5 • Hint: Use vectors and vector functions to store the set of items 2. Get the number of items in the...

  • Done in C++ using visual studio 1. Write a program with one additional function called int[]...

    Done in C++ using visual studio 1. Write a program with one additional function called int[] reverseArray(int array). This function will receive an array from main and then reverse and should return the reversed array to the main to print out. Use a single array and a single loop, you’re are neither allowed to print out just in reverse order nor allowed to use another array variable to store the original array in reverse order. 2. Write a program which...

  • Visual Studio and Visual Basic program b. Serendipity Booksellers has a book club that awards points...

    Visual Studio and Visual Basic program b. Serendipity Booksellers has a book club that awards points to its customers based on the number of books purchased each month. The points are awarded as follows: If a customer purchases no books, he or she earns 0 points. If a customer purchases 1 book, he or she earns 5 points. If a customer purchases 2 book, he or she earns 15 points. If a customer purchases 3 book, he or she earns...

  • I need this in Visual Studio C++ Write a function that count the number of vowels,...

    I need this in Visual Studio C++ Write a function that count the number of vowels, the number of consonants and the average number of letters in each word. The function accept a C-String (char array) or a string object as an argument and return the number of vowels, number of consonants and the average number of letters in each word. Problem: Requirements: . Use pointers as part of the solution Read a string from a text file. . Write...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT