T-Mobile LTE 2:31 PM a bbhosted.cuny.edu ITEM>> FINAL EXAM CLASS >>MAC-125 INSTR
ID: 3912761 • Letter: T
Question
T-Mobile LTE 2:31 PM a bbhosted.cuny.edu ITEM>> FINAL EXAM CLASS >>MAC-125 INSTRUCTOR>M. MULLER 15 Questions: 3 points each: Maximum score -45 1. Insert const before any of the following array parameters that can be changed to constant array parameters void output (double al, int size) //Precondition: a[0] through a[size 11 have values. //Postcondition: a[0] through a size 11 have been written out. void dropodd (int a, int size) //Precondition: a [0] through alsize 1 have values //Postcondition: All odd numbers in alo] through a[size 11 /have been changed to 0.Explanation / Answer
1. void output(const double a[],const int size);
The array and the size of the array are not modified in this case. Only the values are printed.
2. void dropOdd(int a[],const int size);
The array is modified as all the odd numbers are set to 0.So only the size can be made const.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.