Page 1 of 1

4. Write a function my_make_size 10(x), where x is an array and output is the first 10 elements of x if x has more than

Posted: Wed Mar 30, 2022 9:28 am
by answerhappygod
4 Write A Function My Make Size 10 X Where X Is An Array And Output Is The First 10 Elements Of X If X Has More Than 1
4 Write A Function My Make Size 10 X Where X Is An Array And Output Is The First 10 Elements Of X If X Has More Than 1 (21.75 KiB) Viewed 39 times
4. Write a function my_make_size 10(x), where x is an array and output is the first 10 elements of x if x has more than 10 elements, and output is the array x padded with enough zeros to make it length 10 if x has less than 10 elements.
5. Can you write my_make_size 10 without using if-statements (i.e., using only logical and array operations)? 6. Write a function my_letter_grader(percent), where grade is the string 'A+' if percent is greater than 97, 'A' if percent is greater than 93, 'A-'if percent is greater than 90, 'B+' if percent is greater than 87, 'B' if percent is greater than 83, 'B-' if percent is greater than 80, 'C+' if percent is greater than 77, 'C' if percent is greater than 73, 'C-'if percent is greater than 70, 'D+' if percent is greater than 67, 'D' if percent is greater than 63, 'D-' if percent is greater than 60, and 'F' for any percent less than 60. Grades exactly on the division should be included in the higher grade category.