Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment for Matrix Operations in VBA through a windows form application. Option Strict On Public Class frmMain '===================================================================== 'Insert a subroutine to append a given

Assignment for Matrix Operations in VBA through a windows form application.

Option Strict On Public Class frmMain '===================================================================== 'Insert a subroutine to append a given matrix to an existing data file 'Input: A given 2D matrix of any size 'Note: Each number should have two decimal places and separate by "," '=====================================================================

'========================================================================== 'Insert a subroutine to properly display a given 2D matrix using Messagebox 'Input: A given 2D matrix of any size 'Note: Each number should have two decimal places and properly space out '==========================================================================

'============================================= 'Insert a function to transpose a given matrix 'Input: A given 2D matrix of any size 'Output: A tranposed matrix '=============================================

'================================================== 'Insert a function to multiply a matrix by a scalar 'Input: A given 2D matrix of any size; a scalar 'Output: The resultant matrix '==================================================

'======================================================================================================== 'Insert a function to add or to substract two given matrices 'Input: Two given 2D matrices of any size; a boolean variable to indicate whether to add or to substract 'Output: The resultant matrix of the addition/subtraction 'Notes: In this function, the matrices are of the same size. Checking must be done prior to calling ' the function '========================================================================================================

'================================================================================================================== 'Insert a function to multiply two matrices 'Input: Two given 2D matrices of any size. These matrices will have the appropriate dimensions for multiplication 'Output: The resultant matrix 'Notes: Matrix A x Matrix B is not the same as Matrix B x Matrix A 'Notes: In this function, you don't need to check that the matrices can or can't be multiplied. Checking must be ' done prior to calling the function '==================================================================================================================

'======================================================================================= 'Insert a function to find the inverse of a square matrix 'Input: A given 2D square matrix of any size 'Output: The inverse of the given matrix 'Notes: In the function, you can assume that the given matrix is invertible 'Notes: Set up other functions/subroutines to support the inversion of the given matrix '=======================================================================================

Private Sub btnDo_Click(sender As Object, e As EventArgs) Handles btnDo.Click

'******************************************************************************************************** 'Information: 'The data file (DataFile.cvs) is given for your testing purposes. It is in the ..\bin\debug directory 'The arrays and their sizes are random and should be used for your testing purposes 'In the data file, there are two 2D matrices which are separated by an empty line 'Each line in the data file is a row. On each row, the entries are separated by comma "," 'The matrices can be of any sizes. The size of the first matrix may not be the same as the second matrix 'You must use the information from the data file to figure out the size of each matrix '********************************************************************************************************

Dim dblA As Double(,) 'This will be the first matrix in the data file Dim dblB As Double(,) 'This will be the second matrix in the data file

'=========================================================================================== 'Insert codes here to create and initialize arrays dblA and dblB with the data from the file 'Note: You must use information from the data file to determine the size of dblA and dblB 'Note: dblA should be the first matrix. dblB should be the second matrix 'Note: dblA or dblB or both should be used to demonstrate the working of this program 'Note: dblB is not invertible 'Marks: data file accessing (2 marks); create and initialize dblA (7 marks) 'Marks: create and initialize dblB (6 marks) '===========================================================================================

'==================================================================== 'Insert codes here to demonstrate your program can transpose a matrix 'Display the results on MessageBox using the above display subroutine 'Marks: 3 marks '====================================================================

'=============================================================================== 'Insert codes here to demonstrate your program can multiply a matrix by a scalar 'Display the results on MessageBox using the above display subroutine 'Marks: 2 marks '===============================================================================

'============================================================================== 'Insert codes here to demonstrate your program can add or subtract two matrices 'Display the results on MessageBox using the above display subroutine 'Marks: 2 marks '==============================================================================

'============================================================================= 'Insert codes here to demonstrate your program can multiply two given matrices 'Display the resultant matrix on MessageBox using the above display subroutine 'Marks: 3 marks '=============================================================================

'============================================================================ 'Insert codes here to demonstrate your program can inverse a square matrix 'Display the inversed matrix on MessageBox using the above display subroutine 'Notes: dblB or the second matrix in the given data file is not invertible 'Marks: 25 marks '============================================================================

End Sub

Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click Me.Dispose() 'Shut down the program End Sub End Class

image text in transcribed

image text in transcribed

DoraFle csv-Exc nsert Foge Lzyout FoulsDtRi Ve Devoper Hdp Tel me what youwan to do AutoSum Explanotory. rput Uinked Cel Note n DFom Check Cell Clear amalting Tsh x21.5 21.56 2421.44 17019.122.99 20.312.3 10.15 7.6R8.S.3 27.11 28.64 G4.3 22.14 11.33 18.3913.518.261.3 21.51 24.8910.2112.1226.786.42241 17.2 10.451T.72220.99 24.23 0.19

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions