Question: Can someone help with my assignment. This is for visual basic. Thank you! Write code for an event handler that uses a Do loop to
Can someone help with my assignment. This is for visual basic. Thank you!
Write code for an event handler that uses a Do loop to get numbers from the user. If the user enters a negative number, the loop stops. How would you code this without adding a separate if statement inside the loop, and only check for the number being negative in the While condition?
After the loop ends, the code displays the average, max and min value.
For the code to work, get the first entry before the loop, assign it to min, max and the total. You can then use the Do While on the condition that the entry is not negative. Inside the loop you must add up each entry the user provides and count it and keep track of the min and max.
Note that average is calculated as the total divided by the number of entries. This line should be placed after the loop is done.
You can not ask the end user for the number of entries they have.
Remember to add top level comments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
