Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Visual Basic Expert

Create an application that either sums or averages the rows or columns of a two-dimensional array depending on user choices. Use the following data for the array:

5

7

3

9

12

4

8

9

13

4

0

-1

-7

13

8

4

4

4

4

0

Create a menu bar with a File menu that includes a Perform Action command and an Exit command. The Perform Action command computes either the sum or the average of the rows or columns in the array and displays the result in a message box. The Exit command exits the application.

Create a second menu on the menu bar called the Action menu. Add a Sum Rows command, Sum Columns command, Average Rows command, and Average Columns command to the Action menu. Use the RadioCheck and Check properties of each command to allow the user to select a command on the Action menu. The Perform Action command checks to see which command is selected on the Action menu to determine which operation to execute when the user clicks the Perform Action command.

Include appropriate shortcut keys for all commands. After the Perform Action command executes, the program should display the results in a message box. The message box should display results for each row or column separated by a ControlChars.NewLine character. The message box also should ask the user if she or he wants to continue or to exit the application.

The array data should be displayed on your form in a row/column format when the program starts.

The contents of the 2 dimensional array are fixed as given

The user can choose to do one of the four calculations

the sums of columns

the sums of rows

the averages of columns

the averages of rows

The result should be displayed in a message box, with each sum or average starting in a new line, e.g.

Sum Rows

36

38

13

16

The user should be asked whether he or she wants to exit or continue.

Interface Design

Form for the Array Calculations

Create File menu and Action menu on the menus bar

Array application

File

Action

Perform Action

Exit

Sum Rows

Sum Columns

Average Rows

Average Columns

The result Message box

Message and results

Title of the message box

YesNo message button

Default button

Logic

Declare the matrix as a global integer array

Code MenuItem event handler for Action Menu:

Code the MnuSumRow_Click, MnuSumColumn_Click,

MnuAverageRow_Click, MnuAverageColumn_Click event procedures.

Example:

Private Sub MnuSumRow_Click(.....)

MnuSumRow.Checked = True

MnuSumColumn.Checked = False

MnuAverageRow.Checked = False

 MnuAverageColumn.Checked = False

End Sub

Code MenuItem event handlers for File Menu:

- Code MnuExit_Click event procedure

- Code MnuPerformAction_Click event procedure:

If MnuSumRow.Checked Then sum the rows

If MnuSumColumn.Checked Then sum the columns

If MnuAverageRow.Checked Then average the rows

If MnuAverageColumn.Checked Then average the columns

In general,

1. Watch your indices: remember that it runs 0 to 3 for the row index, and 0 to 4 for the column index for a 4 by 5 matrix

2. Beside the sum of each row, use the "ControlChar.NewLine" to start a new line in your string result.

3. You should format your output for the Average operations to show at least one decimal place.

Display the output and give the user a choice to exit:

Name all visual basic files arrayapp. Example, arrayapp.vb1 etc..

Place all files in a zip folder and name zip folder arrayapp

 

Visual Basic, Programming

  • Category:- Visual Basic
  • Reference No.:- M91606096
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Visual Basic

Please show how to do the belowvisual basic net application

Please show how to do the below: Visual Basic .NET Application - Coding Exercise 1 (Exercise 13, Zak, 2016, p. 347) For this coding exercise, write the Visual Basic code for a pretest loop that uses an Integer variable n ...

Assignment virtual storeuse the concepts and scenario from

Assignment: Virtual Store Use the concepts and scenario from Assignment 1 to help "Your" Virtual Business to increase the functionality of its online shopping cart. When a customer checks out, the shopping cart must stor ...

Pitch amp game design documentthe assignment is about

Pitch & Game Design Document The assignment is about educational driver for teenagers Assignment Brief: In groups you will: - present a pitch and produce a one sheet - provide a demonstration of your game - produce a hig ...

Assignment frans virtual fruit standfrans virtual fruit

Assignment: Fran's Virtual Fruit Stand Fran's Virtual Fruit Stand is an online store that sells several types of dried fruit. Based on the needs of Fran's Virtual Fruit stand, you must design a flowchart using Visual Log ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As