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

Application Development for Business Processes Homework for Week 6 Instructor: D

ID: 3601256 • Letter: A

Question

Application Development for Business Processes Homework for Week 6 Instructor: Dr. Eran Rubin 1) Write a function named SeriesSum, which accepts as an input parameter an integer number, and shows in the debug window the sum of all the numbers up to, and including, that number. For example, if the function receives as input the number 4, the debug message will show 10 (since 10 is the result of 1+2+3+4; if the input is 6, the debug window will show 21 (1+2+3+4+5+6) a. 2) Write in the same project another function named CreateTwoDimArray, which accepts as an input parameter an integer number. This function initializes a two dimensional string array in which the number of rows and columns, are each of that number. Le. if the number received is 4, the function creates a 4X4 array. If the number received is 10, the function creates a 10X10 array, etc. The function also initializes all the cells in the array with the string value "Default"; 3) Create a form with two buttons. One will call the function described in (1), the other will call the function described in (2) Submit your zipped project directory.

Explanation / Answer

Solution to question 1 and 2 :

//Part 1 : Returns sum of numbers from 1 to n
public int SerieSum(int n){
return (n*(n+1))/2; //return sum of numbers from 1 to n
}

//Part 2 : creates 2D string array with value = "Default" for all cells
public String[,] CreateTwoDimArray(int n){
  
String[,] array = new String[n,n]; //declare nXn array
  
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
array[i,j] = "Default"; //set value="Default" for all indexes
}
}
return array; //return array
}


**If you have any query , please feel free to comment with details.
**Happy learning :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote