Posts: 1
Joined: Mon Jun 18, 2018 11:00 pm

Exercise Wolfram Mathematica

Mon Jun 18, 2018 11:07 pm

Hi! Can someone please help me try to solve this exercise on Mathematica? I only had
one lesson about this of only two hours in uni and unfortunately already have an assignment due till midnight.

This is the assignment: Define a function "multisum" that finds for a list of integer random numbers the product of these numbers if all numbers are odd, otherwise the sum.
Apply this function to a list of d random integer numbers between -a and a.
For example, if d = 3, then we should get multisum[{-5,3,1}] = -15, whereas multisum[{8,-7,3}] should be 4.
Note: you might think of using commands like Apply, OddQ, Plus and Times.

I would really aprreciate the help!
Thank you!

Return to “Wolfram Language”