Question

In Dr-Racket, which of the following is not necessarily true of a function that takes no...

In Dr-Racket, which of the following is not necessarily true of a function that takes no arguments?

A) It can result in side effects

B) It might return (void)

C) It might return a value like any other function

D) It has the same result every time it is called, since it has no input arguments to deal with

E) It is called like any other function, i.e. inside parentheses

F) It can result in both side effects and return value

Homework Answers

Answer #1

Answer)
In Dr-Racket, the following is valid and necessarily true of a function which takes no arguments:
D) It has the same result every time it is called since it has no input arguments to deal with

The functions which have no arguments required to call them are called like any other function in Dr-Racket without the arguments of course. Such functions may return void, may return some value which is also true for other functions as per the function definition and purpose. Such a function can result in side effects and also return some value. But, the result may not be the same every time the function is called since the function can be dependent on other functions, variables and thus this may not be true every time.

**Please Hit Like if you appreciate my answer. For further doubts on the answer please drop a comment, I'll be happy to help. Thanks for posting.**

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
***************PLEASE GIVE ANSWERS IN RACKET PROGRAMMING LANGUAGE ONLY****************** Write a recursive Racket function "update-if" that takes...
***************PLEASE GIVE ANSWERS IN RACKET PROGRAMMING LANGUAGE ONLY****************** Write a recursive Racket function "update-if" that takes two functions, f and g, and a list xs as parameters and evaluates to a list. f will be a function that takes one parameter and evaluates true or false. g will be a function that takes one parameter and evaluates to some output. The result of update-if should be a list of items such that if x is in xs and (f x)...
Write a Racket function "combine" that takes two functions, f and g, as parameters and evaluates...
Write a Racket function "combine" that takes two functions, f and g, as parameters and evaluates to a new function. Both f and g will be functions that take one parameter and evaluate to some result. The returned function should be the composition of the two functions with f applied first and g applied to f's result. For example (combine add1 sub1) should evaluate to a function equivalent to (define (h x) (sub1 (add1 x))). You will need to use...
Write a Racket function "combine" that takes two functions, f and g, as parameters and evaluates...
Write a Racket function "combine" that takes two functions, f and g, as parameters and evaluates to a new function. Both f and g will be functions that take one parameter and evaluate to some result. The returned function should be the composition of the two functions with f applied first and g applied to f's result. For example (combine add1 sub1) should evaluate to a function equivalent to (define (h x) (sub1 (add1 x))). You will need to use...
Python Related Which of the following statements are true? A. A higher-order function takes as arguments...
Python Related Which of the following statements are true? A. A higher-order function takes as arguments other functions. B. Python is a multi-paradigm programming language. C. Lazy computation is when the CPU is to slow to complete a computation. D. In functional programming languages functions are first-class concepts. E. It's OK to have functions with side effects in pure functional languages.
1. Write a function called compute_discount which takes a float as the cost and a Boolean...
1. Write a function called compute_discount which takes a float as the cost and a Boolean value to indicate membership. If the customer is a member, give him/her a 10% discount. If the customer is not a member, she/he will not receive a discount. Give all customers a 5% discount, since it is Cyber Tuesday. Return the discounted cost. Do not prompt the user for input or print within the compute_discount function. Call the function from within main() and pass...
C++ questions 5.Which of the following function prototype(s) are correct. void setValue(int &value); void setValue(int &);...
C++ questions 5.Which of the following function prototype(s) are correct. void setValue(int &value); void setValue(int &); void setValue(int value, int max=100); void setValue(int ++value); 6. T/F Calling an overloaded function can result in multiple values being returned to the caller. 7.A ____ function has ____ return value(s), but can have ____ parameter(s). Otherwise a function can return _____ value(s). 8.T/F Only variables can be passed as reference. 9.T/F When writing a C++ program you must be careful to arrange all...
8) Write Python code for a function called occurances that takes two arguments str1 and str2,...
8) Write Python code for a function called occurances that takes two arguments str1 and str2, assumed to be strings, and returns a dictionary where the keys are the characters in str2. For each character key, the value associated with that key must be either the string ‘‘none’’, ‘‘once’’, or ‘‘more than once’’, depending on how many times that character occurs in str1. In other words, the function roughly keeps track of how many times each character in str1 occurs...
Use C code please! Write the function definition for a function called FindQuo that takes one...
Use C code please! Write the function definition for a function called FindQuo that takes one argument of type double (arg1 ) and returns a double.  The purpose of the function is to calculate the quotient of arg1 divided by a double (num) that will be entered by the user. Inside the function declare ask and get a double value from the user called num Use a loop (while or do/while) to ensure that the user does not enter a 0.0....
Arrays, loops, functions: Lotto Element Repeated Function Write a function that that takes as parameters an...
Arrays, loops, functions: Lotto Element Repeated Function Write a function that that takes as parameters an array of ints, an int value named element, and an int value named end. Return a bool based on whether the element appears in the array starting from index 0 and up to but not including the end index. Generate Random Array Write a function that takes as parameters an array of integers and another integer for the size of the array. Create a...
Fill in the code for the function below called containsAvgValue. It takes as input a float...
Fill in the code for the function below called containsAvgValue. It takes as input a float array of any length and returns 1 if the array happens to contain a value that equals the average of all the values in the array or 0 otherwise. For example, when give the array [2.0, 2.0] it should return 1 since the average value is 2.0 and the array contains that value. To help you, I’ve included a function that computes the average...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT