Questions Begin Here 1. Write a FUNCTION that will take price as a parameter and give the following discount: PRICE DISCOUNT > 2000 20% > 1000 10%
Q: The swap function shown below does not swap the values of x and y? def main(): X = 1 y = 2 swap(x,…
A: Note: In-order to run the code successfully, use the proper indentation as made in the program…
Q: Question 3 Using function, write the code section that will return the salary of an employee.…
A: The solution to the given problem is below.
Q: a. The function GET JOB below returns a job title when called. Input and run the function to see how…
A: It is defined as the process that helps to find and perform calculations on specific pieces of data…
Q: Which of the following statements is NOT correct? Select one: Oa. A void function does not return…
A: The problem is based on returning properties of functions used in programming languages.
Q: Write a program to perform the following function: • Ask users to enter weight and height • Display…
A: Your C program is given below as you required with an output.
Q: Define a function called get_total_cost(items_dict, items_list) which takes two parameters as input.…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT…
Q: Rewrite your pay computation with time-and-a- half for overtime and create a function called…
A: Here is the approach : Create the function computepay . As the minimum hours is not mentioned so…
Q: A number is said to be Disarium if the sum of its digits raised to their respective positions is the…
A: Algorithm - Take input from the user. Now use the below logic - logic - for val in n:…
Q: n this program, your task is to calculate average of grades and then display the final grade. Your…
A: According to the Question below the Solution: Output:
Q: Question 12: Which argument is optional for the HLOOKUP function? Answer: A. B. C. D. O Lookup value…
A: 1.) Range lookup It is an optional argument for the HLOOKUP function. If it is omitted then HLOOKUP…
Q: Create a main() function, and place lines 23-38 in it. Then add a call to main() at the end of the…
A: To create a main function and call main at the end: use def main() and put all the codes from line…
Q: Create a function which returns how many Friday 13ths there are in a given year. Examples howUnlucky…
A: function howUnlucky(y) { var counter = 0 for(let month = 0; month < 12; month++) { const date =…
Q: Create two functions to calculate the area and circumference of the circle using pointer. Area ():…
A: #include <iostream>//declaring constant pi valueconst float pi=3.14; using namespace…
Q: Prototypes for your user defined functions are: 1. void openFile (ifstream&, string); 2. void…
A: program.cpp #include <iostream> //header file to display to user and read from user…
Q: Write a function that assigns the user defined values to these variables. Write another function…
A: Explanation: - Include all the necessary header files. - Create two functions. One for taking…
Q: • The Emerging Manufacturing Company has decided to use its new computer for payroll. • You have…
A: Java Program: import java.util.*; import java.io.*; class Employee { private String id;…
Q: Hello I just need help creating test cases for the functions below. examples: assertequal,…
A: Lets go step by step 1) Validate_name() True:- false:- 2)validate_company True:- False:-…
Q: the following is a method for redefining a data type? union pointer struct typedef
A: the answe is an typedef
Q: When you create a function that has no return, it automatically returns: a. 0 b. null d. -1 c.…
A: - We need to highlight the option for the return value of a python function if we are not returning…
Q: 10. Please write a stored function named fHW_10_xxxx () which will return the total payment amount…
A: Solution: Considering the name of the schema(database) is student_db. MySQL query for creating…
Q: Create a program for HomeDaddy Construction Company. It prompts the user for a lot number in the…
A: The question is to write C++ code for the given problem.
Q: # Define your function here name user values, upper threshold get user_values()…
A: The main logic to print all numbers less than upper_threshold, for i in user_values: if…
Q: Rewrite your pay computation with time-and-a-half for overtime and create a function called…
A: Program screenshot in python:
Q: In Cpp, Write a program that: Defines an enum named Scoops. The enum Scoops will have 3 data…
A: Algorithm: Start Define an enum named Scoops with data values single,Double,tripple Define…
Q: 1) create food.txt with the following contents turkey 20.80 pie 7.4 stuffing 2.68 2) read the values…
A: C++ program to create file txt and entering the content C++ program to read the text file content
Q: HOW DOI I CALL THIS USING THE FUNCTION AFTER THIS getchar(); printf("Enter name : "); //…
A: Given thatH OW DOI I CALL THIS USING THE FUNCTION AFTER THIS getchar(); printf("Enter name :…
Q: Create the function myFun in your current working folder. Each time you call the function, the value…
A: The Matlab code will be as: function myFun() persistent n if isempty(n) n = 0; end…
Q: LINE NUMBER Create or replace Function House Detailsh_num in townhouse.house_num%Type) RETURN…
A: .
Q: The following function has errors. Locate as many errors as you can. void getValue(int value&) {…
A: GIVEN: The following function has errors. Locate as many errors as you can. void getValue(int…
Q: osts are Store onstant) lists: ITEMS = ["Beans", "Rice", "Banana", "Ice", "Tea", "Bread", "Orange",…
A: Code:…
Q: The function below does not work as expected: If sales is a negative number is returns 3 instead of…
A: Sales Commission$0 - 1000 3%1001 - 5000 4.5%5001 - 10,000 5.25%over 10,000 6%
Q: Define a function called get_total_cost(items_dict, items_list) which takes two parameters as input.…
A: Code:-def get_total_cost(items,selected): #Lets create a variable named no_of_key_errors and…
Q: have the following : st (d1.keys () ) ==list(f1(d1).values ( st (d1.values ())==list (f1(d1).keys (…
A: We need to swap key and values in the given dictionary as per the given code.
Q: 3. Use one of the looping options to plot the functions f (x) = ekr for values of k from -3 to 3 and…
A: Note: Answering the given question in python as no language is mentioned and the first question as…
Q: Which of the following is true? Answer Choices: A pointer cannot be used to point a const type…
A: The value assigned to a const type variable cannot be modified in the entire program.
Q: // Other functions omitted... ItemType get (int i) ( // Copy this function in the answer and write…
A: It stores values of same data types, like all values of integers, character, floats etc. There are…
Q: QUESTION 1 Write a program to help a KJM Cafe to automate their breakfast billing system. a) The…
A:
Q: Write C program to keep records and perform statistical analysis for a class of 20 students. The…
A: Program planning: First, create a student structure with the studentId, studentName, gender,…
Q: can you explain this code with details?
A: Here take whole code and explain it one one in comments. include <stdio.h> //add header file.…
Q: True or false: setInterval() executes a function repeatedly until the interval is cleared by…
A: We are asked a basic question on setInterval() and clearInterval() function.Let's understand it.
Q: Consider the function definition below: def move_character(character, x, y, z):…
A: Given:
Q: Questions P17 and P18 are related to the code skeleton of the function below. The function…
A: Read Dictionary From File in Python:- A Dictionary in Python is collection of key-value pairs, where…
Q: Question 29 Write a Racket function, bmi, that will accept 2 parameters to calculate your body mass…
A: function in racket is given below which take two parameter weight and height and calculate the BMI
Q: 1. Which among the following function can be called without arguments? a) void add(int x, int y=0)…
A: Question 1. Which among the following function can be called without arguments? void add(int x,…
Q: Computer Science create function getRandom
A: SOLUTION IN BELOW STEP
Q: Write a function createPassword() with no return value to randomly select 8 capital letters from the…
A: In C++, to generate a random number rand() function is used. If we set the random number generator…
Q: Student Test 1 Test 2 Test3 Average Student 1 Student 2 Student 3 Student 4 55 88 22 40 58 99 44 88…
A:
Q: ticket_price 이6 Complete the following function according to its docstring description. 1 bef…
A: I have given the completed code below.
Below is part of a Customer’s Order
Customers (customer_id, name, email)
Orders (order_id, customer_id, item, price)
Step by step
Solved in 2 steps
- Rewrite your pay computation with time-and-a-half for overtime and create a function called computepay which takes two parameters (hours and rate). Enter hours:45 Enter rate:10 Pay:475.0Given a declared function header as food(item, qty, price), what is the value of qty when called as food(1.19, “slice of pizza”, 1)? A. “Slice of pizza” B. 1 C. food D. 1.19 Your program must define and call the following function. The function exact_change() should return num_dollars, num_quarters, num_dimes, num_nickels, and num_pennies.def exact_change(user_total)
- In C programming language: Write a function that takes one double parameter, and returns a char. The parameter represents a grade, and the char represents the corresponding letter grade. If you pass in 90, the char returned will be ‘A’. If you pass in 58.67, the char returned will be an ‘F’ etc. Use the grading scheme on the syllabus for this course to decide what letter to return.Question 11 mahTrue or false: 1. A parameter MUST be a variable. 2. There can never be any quotes in the parameter list of the function. 3. Parameters get their values from the function call. 4. You can send the same function different values using the parameters, every time you call the function. Full explain this question and text typing work only We should answer our question within 2 hours takes more time then we will reduce Rating Dont ignore this lineFor the following function, specify the type of its return. You can assume each function is called with an appropriate argument, as specified by its docstring. def f(x, y): """ x: int or float. y: int or float """ x + y - 2 a. float b. int c. int or float d. NoneType e. boolean
- Review the DonationTimeLeft function as a group. What value do you think the function will return if it is given 1300 as the argument? Write your answer below. What information do you think will be stored in time_left after calling DonationTimeLeft(1300)? Which lines of code do you think will call the AnnounceDonation function? Write the line numbers below.Which of the following is false?a. A function can receive information either by value or by reference.b. When a function ends, any variables listed in the function’s parameterList can be used by the statement that invoked the function.c. The variables listed in a function’s parameterList have procedure scope.d. A function uses the Return statement to return a value to the statement that invoked it.Write a function that takes one double parameter, and returns a char. The parameter represents a grade, and the char represents the corresponding letter grade. If you pass in 90, the char returned will be ‘A’. If you pass in 58.67, the char returned will be an ‘F’ etc. Use the grading scheme on the syllabus for this course to decide what letter to return.
- Write a function that asks the user for their birthday month and day and then the function should call a nested function to find out the person’s zodiac sign. Test your program with some user input. Aries: March 21 - April 19 Taurus: April 20 – May 20 Gemini: May 21- June 21 Cancer: June 22- July 22 Leo: July 23 – August 22 Virgo: August 23 – September 22 Libra: September 23 – October 23 Scorpio: October 24 – November 21 Sagittarius: November 22 – December 21 Capricorn: December 22 – January 19 Aquarius: January 20 – February 18 Pisces: February 19 – March 20Q1) Write a function that will take Bid and ask price in dollars, and a) return dollar bid-ask spread (name the function in_ dollar_bidask ) b) compute proportional bid-ask spread (name the function in_dollar_bidask ) c) Write test code to test a) and b)Write a split_check function that returns the amount that each diner must pay to cover the cost of the meal. The function has 4 parameters: bill: The amount of the bill. people: The number of diners to split the bill between. tax_percentage: The extra tax percentage to add to the bill. tip_percentage: The extra tip percentage to add to the bill. The tax or tip percentages are optional and may not be given when calling split_check. Use default parameter values of 0.15 (15%) for tip_percentage, and 0.09 (9%) for tax_percentage. Sample output with inputs: 25 2 Cost per diner: 15.5 Sample output with inputs: 100 2 0.075 0.21 Cost per diner: 64.25 python # FIXME: Write the split_check function. HINT: Calculate the amount of tip and tax,# add to the bill total, then divide by the number of diners. ''' Your solution goes here ''' bill = float(input())people = int(input()) # Cost per diner at the default tax and tip percentagesprint('Cost per diner:', split_check(bill, people)) bill =…