// CST116F2021-Lab4.cpp : This file contains the 'main' function. Program execution begins and ends there. // #include using namespace std; float average(int, int, int, float); int main() { float avg = 0; int input1 = 0, input2 = 0, input3 = 0; do { avg = average(input1, input2, input3, avg); } while (avg == 0); cout << "The average of these values is " << avg; } float average(int input1, int input2, int input3, float avg) { do { cout << "Please input the first value: "; cin >> input1; } while (input1 <= 0); do { cout << "Please input the second value: "; cin >> input2; } while (input2 <= 0); do { cout << "Please input the third value: "; cin >> input3; } while (input3 <= 0); avg = (input1 + input2 + input3)/3; return avg; }