Questions by bjenkins - Page 26
Given main(), build a struct called RandomNums that has three integer data members: var1, var2, and var3. Implement the RandomNums struct and related function declarations (prototypes) in RandomNums.h, and implement the related function definitions in RandomNums.c as listed below. You will have a total of 5 function prototypes and definitions: RandomNums SetRandomVals(int low, int high) - accepts a low and high integer values as parameters, and sets variables var1, var2, and var3 to random numbers (generated using the rand() function) within the range of the low and high input values (inclusive) void GetRandomVals(RandomNums r) - prints out the 3 random numbers in the format: "Random values: var1 var2 var3" int GetVar1(RandomNums r) - returns the value of variable var1 int GetVar2(RandomNums r) - returns the value of variable var2 int GetVar3(RandomNums r) - returns the value of variable var3 You do NOT need to change any code in main.c Use the interactive terminal below your text editor to run your program (type run), input test values, and debug as needed. For full credit, you must use proper formatting indentation and whitespace) and include appropriate comments in your code. You will have limited submissions (10), so be sure to run your program with different input values in develop mode before you submit for grading. Ex: If the input is: 15 20 the output may be: Random values: 17 15 19