Question: #include #include #include #include using namespace std; int main() { srand(time(NULL)); int intnum_1, intnum_2, intnum_3; float avg_value; //Write code to place number as per specifications

#include #include #include #include using namespace std; int main() { srand(time(NULL)); int intnum_1, intnum_2, intnum_3; float avg_value; //Write code to place number as per specifications into intnum_1 intnum_2 = rand() % 21; intnum_3 = rand() % 21; print_numbers(intnum_1, intnum_2, intnum_3); avg_value = get_average_value(intnum_1, intnum_2, intnum_3); cout << fixed << setprecision(1); cout << "Average value = " << avg_value << endl; return 0; }

Lines 10 and 11 declare 3 int variables and 1 float variables. The 3 int variables are populated using random number generation. In order to complete this program, complete these steps:

Write a loop to ensure that intnum_1 is

Between 1 and 50

It is a multiple of 6

Implement the print_numbers function by:

Defining the function

Coding a function prototype

Implement the get_average_value function by:

Defining the function

Coding a function prototype

Sample output

#1 (multiple of 6)=30, #2=12, #3=1

Average value of first 2 numbers = 14.3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!