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,...

  • Create a Sale Price Calculator Application Using Visual Basic Write a simple program in VB to...

    Create a Sale Price Calculator Application Using Visual Basic Write a simple program in VB to calculate the sale price of a retail item. You are required to define a function to validate the two inputs: the retail price, and the discount percentage. You are also required to define another function for calculating the sale price. Besides that, you must include the steps of the Software Development Method, source code, GUI (screenshot), and their output (screenshot).

  • 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),...

  • Description -- Microsoft Studio, Visual Basic Problem 6.1 Words Reversed - Write a program that uses...

    Description -- Microsoft Studio, Visual Basic Problem 6.1 Words Reversed - Write a program that uses a Do Loop so that the user may enter words using a popup Input Box. Once the user enters "STOP" , the program then displays all the words in a single string. The difficulty is that the words are displayed in reverse order with spaces. The program is initiated with a button. For example: The following words are entered separately one at a time:...

  • 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...

  • in a c++ visual studio 2017 ...Write a program that simulates a lottery. The program should...

    in a c++ visual studio 2017 ...Write a program that simulates a lottery. The program should have an array of five integers named lottery and should generate a random number in the range 0 through 9 for each element in the array. The user should enter five digits, which should be stored in an integer array named user. The program is to compare the corresponding element in the two arrays and keep a count of the digits that match. For...

  • 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...

  • 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...

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