
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
What 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 used
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

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
- What is the default return type of main function? a. void O b. No default type O c. int O d. floatarrow_forwardWrite a function called money() that asks the user how many quarters and nickels and dimes they have, then return the total amount of money those coins are worth. The program should have at least two functions (main and one more). Style (Names of variables/parameters/arguments, indentation) needs to be correct.arrow_forwardCan you use Python programming language to to this question? Thanksarrow_forward
- I can't seem to figure this out.. for python You have a business that cleans floors in commercial space and offices. You charge customers $0.45 per square yard, and some customers require multiple cleanings every month. You need two custom functions for your business. The first function takes a floor's length and width in feet and returns the area in square yards. The second void function takes the area, charge per square yard, and number of monthly cleanings as arguments and prints the cleaning cost. This latter function uses selection logic to print different output for single and multiple monthly cleanings (see Sample Outputs). Use a properly named constant for the charge per square yard, too.arrow_forwardWrite in Python Write a function named max that accepts two float values as arguments and returns the value that is the greater of the two. For example, if 7.2 and 12.1 are passed as arguments to the function, the function should return 12.1. Use the function in a program that prompts the user to enter two float values. The program should display the value that is the greater of the two.arrow_forwardHello! Can you please answer the following questions? The example output is attached and the program is in Pyhton. Thank you! program5_2.pyThis program requires a main function and two custom functions about spheres. Both functions take the radius of a sphere as an argument. One function returns the surface area of the sphere. The other void function prints the volume of a sphere to three decimal places. The main function should prompt the user for the radius (as a float) and execute the custom functions. The value returned by the surface area function should be printed accurate to four decimal places. Use the math module to get the value of pi. Formulas for both the surface area and the volume of a sphere are available through an internet search. Input prompts and output should be formatted as in the example output. program5_3.pyThis program should import program5_2 as a module. The main function of program5_3 should prompt the user for the radius (as a float) and execute the…arrow_forward
- What happens if a value stored in an int variable gets too big?a. The program stops and reports an error.b. Nothing happens. The compiler makes the variable bigger.c. The variable will contain the wrong value.d. The variable automatically changes into a double.arrow_forwardWrite a function that has a single input argument grade. If the user's input is a numeric number, the grade letter should be displayed to the command window depending on the value of grade, as shown in the table below. Otherwise, MATLAB should stop the execution and send an error message: "invalid input" to the command window. Grade Grade Letter Grade 2 90 A 90 > Grade 2 80 80 > Grade > 70 70> Grade 2 60 60> Grade Grade >100 or Unknown Grade using namespace std; int main) ( int score; char grade; coutss"Enter score: "; cin>>score; if(score100X cout<arrow_forwardThis for python programmingarrow_forward
- Write a function called Strange with two parameters A and B, where B has the default value of 100. The value returned from the function is A-B if A is bigger than B, but returns B-A otherwise. (Note that there will be no print statements in this function, and you will be penalized if you use them.)write this function with only the def and return statements, but no other lines of code. Do not use: value1 if condition else value2arrow_forwardThe prompt asks me to write a program that asks the user to enter an object’s mass, then calls a function to calculate the object's weigh in newtown. If the object weighs more than 500 newtons, display a message indicating that it is too heavy. If the object weighs less than 100 newtons, display a message indicating that it is too light.arrow_forwardI ran the code and still got the same error. The code still needs the value head. Please fix the code and show screenshots of the correct code with the output. Make sure to use various test cases to test the code to make sure it works. Attached are images of the directions.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education