Question: Write Visual Basic code, which upon clicking a button called btnCalc reads the full number values c, i from two text boxes (txtC, txtI) reads
Write Visual Basic code, which upon clicking a button called btnCalc reads the full number values c, i from two text boxes (txtC, txtI) reads a number o between 1 and 100 from a textbox (txtO) creates a matrix c x i, which is filled randomly with the values 0 or 1 independently for each matrix field. The value 1 is chosen with the probability specified by variable o (interpreted as percentage 100 corresponds therefore to 100% probability, 1 to 1% probability, respectively) counts the number of 1s in the matrix in variable pCount finds the number of points in the matrix, where a 1 has neighbors with the value 1 in all in all four neighboring fields (left, right, above, below) and stores it in variable nCount. outputs the variables pCount and nCount in the Textboxes pCountTxt and nCountTxt
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
