ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 03 May 2017 My Price 9.00

CSC242 Exercise Question

Hello,tutor.I want to ask you a question about CSC 242 exercise question.Please you help me to respond this question.Thank you.

 

 

CSC242 Exercise Question: Write a recursive function get Tot () that returns the sum of a given list passed in as a
parameter that occurs in an arbitrarily nested list of numbers. If the list is empty, the function
returns 0. Otherwise the function returns the sum of all values in the list.
Note that your function must be recursive. You are not allowed to use any list methods in your
function other than indexing (e.g. lst [i] for some integer i, or len (). You are encouraged to
use the type () function. In writing the function you should not use any loops or global
variables, and you cannot change the number of parameters of the function or define any helper
functions. You may assume that the initial values given to the function are a list and your
function does not have to behave in any reasonable way when given something other than a list
as a parameter. The function must return and not print the count of the number of occurrences of
the string.
The following shows the behavior of the function on some sample parameters. Please remember
that these examples are just that. Your function must work correctly on all valid parameters, and
you may not make any assumptions about the number of nested in the parameter list.

Attachments:

Answers

(11)
Status NEW Posted 03 May 2017 08:05 AM My Price 9.00

-----------

Not Rated(0)