Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have a project in Visual Basic 2012 regarding Arrays. We are asked to create a

ID: 3820278 • Letter: I

Question

I have a project in Visual Basic 2012 regarding Arrays. We are asked to create a form with only one button that will execute multiple commands. The user will enter x number of integers using the input box command. Based on these integers, we have been asked to code a button that executes the following commands: Sum Average Lowest index Highest index Sort Find replace
This needs to be done using the "Call" function so at the end of all of this code, it will be something like: Select case .... Case.... CALL THIS CODE Case.... CALL THIS CODE
And so on I have a project in Visual Basic 2012 regarding Arrays. We are asked to create a form with only one button that will execute multiple commands. The user will enter x number of integers using the input box command. Based on these integers, we have been asked to code a button that executes the following commands: Sum Average Lowest index Highest index Sort Find replace
This needs to be done using the "Call" function so at the end of all of this code, it will be something like: Select case .... Case.... CALL THIS CODE Case.... CALL THIS CODE
And so on Sum Average Lowest index Highest index Sort Find replace
This needs to be done using the "Call" function so at the end of all of this code, it will be something like: Select case .... Case.... CALL THIS CODE Case.... CALL THIS CODE
And so on

Explanation / Answer

Private Sub cmdTryIt_Click()

Dim numbers[] As int

numbers[] = InputBox("enter integers:", "Input ", "")

Dim choice = Console.ReadLine();

switch(choice )

{

case1:

sum();

break;

case 2:

average();

break;

case 3:

lowindex();

break;

case4 :

highindex();

break;

case 5 :

sort();

break;

case 6:

freplace();

break;

default:

break;

}

sum()

{

for (i=0;i<=numbers.length();i++)

{s=s+number[i];

}

}

average()

{ int i,s=0;

for (i=0;i<=numbers.length();i++)

{s=s+number[i];

}

float avg=s/numbers.length();

}

sort()

{

for (i=0;i<=numbers.length();i++)

{

for (int j=1;j<=numbers.length();j++)

{if(numbers[i]>numbers[j]

{

t=number[i];

numbers[i]=numbers[j];

numbers[j]=t;

}}

for (i=0;i<=numbers.length();i++)

{

}

}