Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write this in Racket programming language without using for-loops 7. Write a function called my-sum that accepts a list. The function should return a
Please write this in Racket programming language without using for-loops
7. Write a function called my-sum that accepts a list. The function should return a sum calculation based on the following rules: 1) if the number in the list is a zero, then add one to the sum, 2) if the number in the list is an even number, then add the double of that number to the sum, and 3) if the number in the list is an odd number, then add the square of that number to the sum. > (my-sum '(1 2 3 4 5)) 47 > (my-sum '(0 0 0)) 3 > (my-sum '(2 4 6 8)) 40 > (my-sum '(0 5 0 4 3 0 2 0 1)) 51Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started