Computer Science: A Structured Programming Approach Using C, Third Edition
3rd Edition
ISBN: 9780534491321
Author: Behrouz A. Forouzan, Richard F. Gilberg
Publisher: Course Technology, Inc.
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 4, Problem 9PS
Which of the following statements about function parameters is true?
a. Empty parameter lists are declared with the keyword void.
b. If there is only one parameter, the function list parentheses are not required.
c. In the definition of a function, the parameters are known as actual parameters.
d. Parameters are separated by semicolons.
e. The parameters in a function definition are defined in the function's body (local declaration section).
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Change this question to work
using a function. decide what the name of the
function of each should be, how many parameters
are required and what value needs to be returned.
You're no longer required to solve the problem - try
to re-manage your code to be a function.
In many jurisdictions a small deposit is added to drink containers to encourage people
to recycle them. In one particular jurisdiction, drink containers holding one liter or
less have a $0.10 deposit, and drink containers holding more than one liter have a
$0.25 deposit.
Consider the following function call:
draw_circle('red', 3)
What is the function name and what is the first argument passed to the function?
a.
The function name is draw_circle and the first argument is 3.
b.
You need to see the function definition to determine the function name and arguments.
c.
The function name is draw_circle, but you need to see the function definition to determine the arguments.
d.
The function name is draw_circle and the first argument is 'red'.
e.
The first argument is 'red', but you need to see the function definition to determine the function name.
Which statement below is true about a function:
may have no parameters
must always have a return statement
must have at least one parameter
its arguments always appear within brackets
Chapter 4 Solutions
Computer Science: A Structured Programming Approach Using C, Third Edition
Ch. 4 - Prob. 1PSCh. 4 - The function definition contains the code for a...Ch. 4 - Function calls that return void may not be used as...Ch. 4 - The address operator (&) is used to tell the...Ch. 4 - Variables defined within a block have global...Ch. 4 - Prob. 6PSCh. 4 - Which of the following statements about function...Ch. 4 - Which of the following is not a part of a function...Ch. 4 - Which of the following statements about function...Ch. 4 - Which of the following statements about local...
Ch. 4 - Prob. 11PSCh. 4 - Prob. 12PSCh. 4 - Which of the following statements will generate a...Ch. 4 - Which of the following statements about structure...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function...Ch. 4 - Find any errors in the following function calls:...Ch. 4 - Evaluate the value of the following expressions:...Ch. 4 - Evaluate the value of the following...Ch. 4 - Prob. 23PSCh. 4 - Define the range of the random numbers generated...Ch. 4 - What would be printed from Program 4-17 when run...Ch. 4 - Prob. 26PSCh. 4 - Prob. 27PSCh. 4 - Prob. 28PSCh. 4 - Prob. 29PSCh. 4 - Write a program that generates a random number...Ch. 4 - Prob. 31PSCh. 4 - Code and run Program 4-16, "Top—down Development...Ch. 4 - Prob. 33PSCh. 4 - Prob. 34PSCh. 4 - Expand the calculator program, Program 4-15, to...Ch. 4 - Prob. 36PSCh. 4 - Write a function that receives a positive...Ch. 4 - Prob. 38PSCh. 4 - Prob. 39PSCh. 4 - Prepare a payroll earnings statement for the sales...Ch. 4 - Write a program that, given a beginning balance in...Ch. 4 - The formula for converting centigrade temperatures...Ch. 4 - Write a program that uses standard functions. The...Ch. 4 - Write a C program that creates customers' bills...
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 17. A function should determine the average of x and y. What should be the function's parameters and return value(s)? A.Parameters: none Return values: X,y B.Parameters: ×, y, average Return value: none C.Parameters: average Return values; X, y D.Parameters: X, y Return value: averagearrow_forwardGiven the following function prototype, which of the following call statements are invalid? For each invalid function call, give the reason why it is invalid. Function Prototype: void tester(int num, int&num1, int & num2); int num1=2, num2,num3; tester (num1-9,num2,num3); _______________________________________.arrow_forwardWrite a function with one integer parameter that will return the sum of the divisors of its argument c++arrow_forward
- 2. If a function have all the default arguments but still some values are passed to the function then _________.arrow_forwardWhen is the code nested within the function declaration executed? In other words, when does the code in the function's body execute?arrow_forwardExplain and print the output of the above code when the parameters to the foo function are:1. Passed by value2. Passed by reference3. Passed by value result4. Passed by name.arrow_forward
- Which of the following statements is true or false? If the answer is no, explain why. "In a function definition, empty parenthesis after a function name indicate that the function does not need any arguments to do its work."arrow_forwardWhen is the body of a function executed? A. When the function is defined B. When the program begins to run C. When the function is called D. Shortly after it is convicted Which selection below best answers the question, "How many parameters can a function have?" A. zero or more B. one or more C. none D. up to five How is the body of a function defined? A. The body of a function must be registered at python.org B. By placing the code between the 'def' and 'end' statements C. By surrounding the code immediately following the 'def' statement with curly braces '{}' D. By indenting the lines of code immediately following the 'def' statementarrow_forwardTo make a function return more than one result we pass parameters: By value. As int. By void. By reference.arrow_forward
- Assume function call below will replace the comment in the main(). What should be the data type in the formal parameter in the function prototype of fD()? Note that your answer should not include any variable name. Remove all spaces from your answer. fD( strcmp(strB, strA) );arrow_forwardWhat statement about the print() function is true? A. print() has a variable number of parameters. B. print() can have only one parameter. C. print() can be used to obtain values from the keyboard. D. print() does not automatically add a line break to the display. After a function calculates a value, how does it return that value to main program where it was called? A. By including that value in a return statement. B. By using the print() function C. By storing the value in a local variable. D. Since function variables are destroyed when the function call is completed, the calculated values are destroyed as well. Where in a program should a function be defined? A. At the very end B. Immediately after the first call to the function C. Near the top of the program D. Functions do not have to be defined to be usedarrow_forwardGiven the function definition below, select the return values for the following function calls.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Python - bracket parenthesis and braces; Author: MicroNG;https://www.youtube.com/watch?v=X5b7CtABvrk;License: Standard Youtube License