Home / Expert Answers / Accounting / i-complete-the-function-definition-for-getinteger-4-marks-ii-complete-the-function-defini-pa970

(Solved): i. Complete the function definition for getInteger(). [4 Marks] ii. Complete the function defini ...



This CH+ program accept 10 integers range in between 10 and 15 from a user. If the user enters an
integer that is out of the

i. Complete the function definition for getInteger(…). [4 Marks]

ii. Complete the function definition for countFrequency(…). [3 Marks]

iii. Complete the function definition for displayOutput(…). [3 Marks]

This CH+ program accept 10 integers range in between 10 and 15 from a user. If the user enters an integer that is out of the range, an error message appears and the integer will not be stored. All the in- range integers will be stored in an array. The program then counts the frequency of each integer that stores in the array. The main function is given below. The program calls getInteger (...) function to prompt user to enter integer numbers and store them into the respective element of the array. It then calls countFrequency (...) function to compute the frequencies of each integer in the array. Lastly, displayOutput (...) function is called to display the output on screen. int main() // array declaration int countArr[6] = {0}, numArr [10]; get Integer (numArr); count Frequency (numArr, countArr); displayOutput (countArr); return 0; Sample Output Enter an integer between 10 and 15: 10 Enter an integer between 10 and 15: 10 Enter an integer between 10 and 15: 12 Enter an integer between 10 and 15: 13 Enter an integer between 10 and 15: 8 ERROR: Integer must between 10 and 15 Enter an integer between 10 and 15: 14 Enter an integer between 10 and 15: 15 Enter an integer between 10 and 15: 16 ERROR: Integer must between 10 and 15 Enter an integer between 10 and 15: 15 Enter an integer between 10 and 15: 15 Enter an integer between 10 and 15: 10 Enter an integer between 10 and 15: 12 The frequency of the integer: Integer 10: 3 Integer 11: 0 Integer 12: 2 Integer 13: 1 Integer 14: 1 Integer 15: 3 Note: Blue color indicates the user key-in value.


We have an Answer from Expert

View Expert Answer

Expert Answer


If you have any problem with the code feel free to comment. Program #include using namespace std; void getInteger(int *numArray) { int i = 0; int input; while (i < 10) { // taking user input cout << "Ente
We have an Answer from Expert

Buy This Answer $5

Place Order