we can execute a saved function by writing the function name in the : figure window O work space O command window O which is not a function that adds text to plot legend O text O label O title O
Q: PYTHON HOMEWORK QUESTION def area(side1, side2): return side1 * side2 s1 = 12 s2 = 6 Select…
A: Here, a function area is defined which is accepting 2 arguments and then returning the area by…
Q: Computer science When a function accepts multiple arguments, does it matter what order the arguments…
A:
Q: True or false: When an object is passed to a function, but the function is not supposed to change…
A: An object is passed to a function by value, and then it creates a copy of the object.
Q: Design a pseduocode function named timesTen that accepts an integer arguement. When the function is…
A: Function timesTen Pass In: any integer "num" as parameter Compute : result = num *…
Q: A __________ is a variable that is created inside a function.a. global variableb. local variablec.…
A: A local variable is a variable that is created inside a function.
Q: C++ If you pass a variable by ________________ to a function, the function will make a local copy…
A: In pass by reference we make a local copy of the variable and changes to parameter are not made to…
Q: This standard library function returns a random floating-point number within a specified range of…
A: Answer: d
Q: _______ are variables available only within the body of a declared function. A. Arguments B. Globals…
A: Arguments : An argument is the value that is sent to the function. Globals : Variables declared…
Q: //The function must return the value indicated in the comments // The calcDiscountPrice function…
A: As given, we need to find out the variable value that needs to be returned from the function.
Q: 2. What data type would you use to allow a function to receive an Int or nil value as its parameter?…
A: Data type used in display function of the program
Q: PYTHON PROGRAMMING ASSIGNMENT PYTHON PROGRAMMING LANGUAGE ASSIGNMENT Create a new text…
A: I have uploaded the Images of the code, Typed code and Output of the Code. I have provided…
Q: Using VBA program and using excel Write a function which takes as input a planet name and returns a…
A: In this question we have to write a VBA code for the function which takes input a planet name and…
Q: Be able to define your function using pseudocode and flowchart, also be able to call your function…
A: Pseudocode: Function Integer sum (Integer num1, Integer num2) Declare Integer result…
Q: In this lab, you complete a partially written Python program that includes a function that returns a…
A: Process: Calculator.py - This program performs arithmetic, ( +. -, *. / ) on two numbers.Input:…
Q: Write a statement that calls the function printErrorDescription, passing it the value 14.
A: Solution of the given question is:-
Q: Which value is not an argument to the "hello" function? def hello(name): print("Hey,", name) hello…
A: def hello(name): print("Hey,", name)hello("john")hello("Mya")Explainationhello method take one…
Q: Add this comment: # Ass 1: Part 3 Define two functions: The first one is called: YourIntAsString…
A: Code import java.util.*;public class Main{ String YourIntAsString(int x){ String arr[] =…
Q: Design a pseduocode function named getFirstName that asks the user to enter his or her first name…
A: I have given an answer in step 2.
Q: Filename: AngleToRadianProblem_FamilyName Create a flowchart and a java program that will read an…
A: ALGORITHM:- 1. Take input from the user about the values of all unknowns. 2. Declare a variable…
Q: Function Name: dominosTime() Parameters: N/A Returns: None Description: During the summer, you…
A: Python used to answer this question
Q: 1 function safeTemperature = CheckTemperature(foodTemperature) 2 % foodTemperature: Temperature…
A: function safeTemperature = CheckTemperature(foodTemperature) % 0 indicates food is not at a safe…
Q: What are the pieces of data that are passed into a function called?
A: Data Passed into the Function The pieces of data that are passed into the function when a function…
Q: get_user_input(message, sentinel): The parameter message is the string message to request an integer…
A: Required: get_user_input(message, sentinel): The parameter message is the string message to…
Q: Function Name: compliments Parameters: answer1 - a boolean (True or False) representing whether the…
A: Solution:The following function displays the outputs as string of compliments.
Q: ____ are declared within the body of a function. (A) Variables (B) Local variables (C) Main…
A: Local variables are declared within the body of a function.
Q: c++ If you pass a variable by ________________ to a function, the function will have access to…
A: Given : c++ If you pass a variable by ________________ to a function, the function will have…
Q: A program contains the following function. int cube(int num) {return num * num * num; }Write a…
A: Function Call The function accepts a number of type int as a parameter and returns the cube value of…
Q: Which line of code reserves space in memory and which line puts a value into memory? LINE 1: int x;…
A: Please find the answer below :
Q: IN PYTHON Write a script which uses the input function to read a string, an int, and a float, as…
A: In Python, input() method is used to take the input from the user. int() method is used to convert…
Q: eate a function called volume The function will calculate the volume of a cube. It will receive 3…
A: Here's a Python implementation of the "volume" function that calculates the volume of a cube: def…
Q: 5. Falling Distance determine the distance the object falls in a specific time period: 1 d = The…
A: iterate from i=1 to i<=10 FallingDistance(i) end loop Define function fallingDistance(int…
Q: In C++ please, using basic programming one coding The main menu should show the available…
A: C++ is a cross-platform language that can be used to create high-performance applications, and it…
Q: Create a function that will take in a users speed, then check to see if the speed is within: over…
A: Use an if-elseif ladder based on the function parameter speed and a respective message is printed
Q: Write a function named Weight that when called in the command window will compute the weight in…
A: As per the given question, we need to write a function that converts weight in kilograms to weight…
Q: Function SecondsToMinutes(float totalSecs) returns float resultMins // Calculate resultMins:…
A: Start the program.Define the function "SecondsToMinutes" that takes a float parameter "totalSecs"…
Q: In C/C++, True or False: A function that changes the value of a variable passed by reference also…
A: Answer is given below
Q: The ________ function returns no value. a) malloc() b) realloc() c) free() d) calloc()
A: Given, Statement: The ________ function returns no value. Choices: malloc() realloc() free()…
Q: Tracking laps Learning Objectives In this lab, you will practice writing functions, passing…
A: Given :- An Olympic-size swimming pool is used in the Olympic Games, where the racecourse is 50…
Q: Q6: Complete the function that takes in a number x, and returns the value 1 if x > 0, otherwise it…
A: ## Define the function def step_function(z): # If the number is greater than or equal to 0, we…
Q: C code for a program. The program should use a function to display a message and prompt the user to…
A: You can copy the below code and save it in a .c file (e.g., dog_age.c). Make sure to include your…
Q: A variable with ______ scope has storage created for it by a declaration statement located outside…
A: Global Variable: A variable specified outside the subroutine or function is known as a global…
Q: PYTHON PROGRAMMING LANGUAGE Create a new text document called names.txt (this is done by hand -…
A: Here, you need to write three functions such as main, readFunction and writeFunction. Main function…
Step by step
Solved in 4 steps
- Text-based adventure game: Pretend you are creating a text-based adventure game. At different points in the game, you want the user to select to fight, run, or hide from certain enemies. Modify the application below (week3.py) so that the selection variable is sent as an argument into the choice() function. The user should enter 1 to fight, 2 to run, or 3 to hide in the main(). The choice() function should print one of the three options. You will need to add an if statement in the choice() function to make the correct selection.2. Create a module named grading that contains the following two functions: • calc_average() – this function should accept five (integer) test Scores as arguments and return the average of the scores. • determine_grade() – this function should accept a test score as an argument and return a letter grade (string) for the score, based on the following: A 90-100 80-89 C 70-79 60-69 F Below 60 Write a program that imports your grading module. Your program should include a main() function that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score rounded to 1 decimal place.Assignment #2 Instructions: Through this programming assignment, the students will learn to do the following: Learn to work with command line options and arguments Gain more experience with Makefiles Gain more experience with Unix Learn to use some of the available math funtions available with C Usage: mortgagepmt [-s] -r rate [-d downpayment] price In this assignment, you are asked to perform the mortgage payment calculation. All information needed for this will be passed to the program on the command line. There will be no user input during the execution of the program You will need a few pieces of information. The price of the home and the amount of the down payment. You will also need to know the interest rate and the term of the mortgage. To figure your mortgage payment, start by converting your annual interest rate to a monthly interest rate by dividing by 12. Next, add 1 to the monthly rate. Third, multiply the number of years in the term of the mortgage by 12 to calculate…
- Assignment Name JavaScript Concepts III Assignment Filename lastname-circleArea.html (replace lastname with your last name). area.js Assignment Description This assignment demonstrates the following concepts: JavaScript Functions Assignment Instructions Write a JavaScript program that calculates the area of a circle: Write a function that calculates the area of a circle given the radius. Formula: Math.PI * (radius * radius) Your program code should contain appropriately named variables. Use documentation to identify various components of your program. Call the function once and pass a radius value of 10.75 to it. Use the starter files and complete the logic to satisfy the instructions. To access the files, download and save the circleArea.zip folder attached to this assignment. Then unzip the compressed folder to reveal the included files: circleArea.html and area.js. Be sure that the two files are in the same folder. Then write your code in the area.js…er 6 Functions Programming Exercises te 1. Rectangle Area ngle Area The area of a rectangle is calculated according to the following formula: Area = Width X Length Design a function that accepts a rectangle's width and length as arguments and returns the rectangle's area. Use the function in a program that prompts the user to enter the rectangle's width and length, and then displays the rectangle's area.Coin Toss Write a function named coinToss that simulates the tossing of a coin. When you call the function, it should generate a random number in the range of 1 through 2. If the random number is 1, the function should display "heads". If the random number is 2, the function should display "tails". Demonstrate the function in a program that sks the user how many times the coin should be tossed and the coin then simulates the tossing of the coin that number of times.
- Python Returning function function name: is_prime parameters: a number n returns: True if n is prime behavior: Check the values in the range [2, n) and return False if n is divible by any of them. function name: bound_0_to_100 parameters:a number grade returns: the grade with a minimum of 0 and a maximum of 100 behavior: In addition to exceeding 100, sometimes a grade will be so spectacularly bad that it falls below 0. In that case we want to normalize it to 0 so all grades fall into the range [0, 100]. ex: bound_0_to_100(75) returns 75, bound_0_to_100(103) returns 100, and bound_0_to_100(-5) returns 0 function name: bigger parameters: two values a and b returns: whichever of the two is greatest behavior: ex: bigger(3, 9) returns 9Create the pseudocode for a program that will Create a file of functions and place them into a functions.py file Make a new program called CallFunctions and import the functions.py file Call each of the functions in the functions fileCalling a function is also called ____ a function. Group of answer choices casting initializing invoking delegating
- Create and run the following python scriptsScript 1: User InfoWrite a program that asks the user for his or her name, then asks the user to enter a sentencethat describes himself or herself. Here is an example of the program’s screen:Your program should meet the following requirements: Be a function named “main” The program should ask for the age of the user. If user is less than 18 years old, programshould terminate and write a message to “error.txt” file. But if user is 18 years andabove, program should prompts user to enter full names and give a description. Thesedetails should then be written to a file – “userinfo.txt”.**You must use input and function to complete this task**An ELSE block must be included in the codeAssignment #2 Instructions: Through this programming assignment, the students will learn to do the following: Learn to work with command line options and arguments Gain more experience with Makefiles Gain more experience with Unix Learn to use some of the available math functions available with C Usage: mortgagepmt [-s] -r rate [-d downpayment] price In this assignment, you are asked to perform a mortgage payment calculation. All information needed for this will be passed to the program on the command line. There will be no user input during the execution of the program You will need a few pieces of information. The price of the home and the amount of the down payment. You will also need to know the interest rate and the term of the mortgage. To figure your mortgage payment, start by converting your annual interest rate to a monthly interest rate by dividing by 12. Next, add 1 to the monthly rate. Third, multiply the number of years in the term of the mortgage by 12 to calculate the…Question 6 # This function checks whether a given number is even or not def isEven(number): """ what it takes? a number what it does? determines if a number is even what it returns? if even, return 1 if odd, return -1 """ # your code goes in here defisEven(number): #check if the number is divisible by 2 by checking the remainder. if number % 2==0: #If remainder is 0, then its divisble by 2 and an even number #hence return-1 return1 else: #if remainder is not 0, it'll be 1, so its NOT divisible by 2 and its an odd number #hence return -1 return-1 Test case for question 6 try: if isEven(5) == -1: score['question 6'] = 'pass' else: score['question 6'] = 'fail' except: score['question 6'] = 'fail' isEven(5)