Question: using System; public static class Lab 4 _ 1 { public static void Main ( ) { int value = 0 , sum = 0
using System;
public static class Lab
public static void Main
int value sum count ;
double average ;
Console.Clear;
Read initial value seed the loop
Console.WriteEnter a positive integer to stop: ;
value Convert.ToIntConsoleReadLine;
if the inputted value is not the sentinel value, process it
while value
Calculate the running total
sum value; same as sum sum value;
Keep track of the number of inputted values
count; same as count count ;
Read next value
Console.WriteEnter a positive integer to stop: ;
value Convert.ToIntConsoleReadLine;
Calculate average only if the user inputted any numbers
if count
average sum double count;
else
average ;
Print results
Console.WriteLinesum count sum, count;
Console.WriteLineaverage :F average;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
