• 2. Can you find the reason that the following pseudocode function does not return the value indicated in the comments? // The calcDiscountPrice function accepts an item's price and |/ the discount percentage as arguments. It uses those || values to calculate and return the discounted price. Function Real calcDiscountPrice (Real price, Real percentage) /| Calculate the discount. Declare Real discount = price * percentage // Subtract the discount from the price. Declare Real discountPrice = price – discount // Return the discount price. Return discount End Function
Q: Create a function that takes a number as an argument and returns "Fizz", "Buzz" or "FizzBuzz". If…
A: In this problem, we need to design the code in the Python programming language. Input - Integer…
Q: Using the CelsiusToKelvin function as a guide, create a new function, changing the name to…
A: C++ program to create a function KelvinToCelsius#include <iostream>using namespace std;double…
Q: def pay(hours, pay_rate): pay = hours * pay_rate print(f'pay is ${pay:.2f}')…
A: In the Given code, def pay(hours, pay_rate): pay = hours * pay_rate print(f'pay is…
Q: ython!!!!! Create a function, showEmployment. It will have three arguments. 1. Employees:…
A: Python is the code in which that can emphasis the significant that has the object-oriented…
Q: Ibra Bakery wants you to create a simple python program for calculating cashback offers on cakes for…
A: In step 2, you will get python code. In step 3, you can see the sample output.
Q: change.py Create a program, change.py, that has a function that takes 5 arguments that…
A: According to the information given:- We have to follow the instruction to create a program,…
Q: Write a function that displays the sum of two fractions (a/b) and (c/d). Example function sum(a, b,…
A: As no programming language is mentioned here I am answering in C. Written code:…
Q: Create a function that returns an Earned Run Average (ERA). An ERA is calculated by multiplying 9 by…
A: /*Step-1: StartStep-2: function era(er, ip) Step-2.1:Declare variable ERA and initialize with (er…
Q: • 2. The following pseudocode statement calls a function named half, which returns a value that is…
A: The problem is based on the basics of functions in programming languages.
Q: Create a function that takes three arguments prob, prize, pay and returns true if prob * prize ›…
A: In this problem, we need to design the javascript programming language. Input - three argument…
Q: • 2. Can you find the reason that the following pseudocode function does not return the value…
A: When given price and percentage formula for discount is discount=price*(percentage/100); So first…
Q: Create a function that returns an Earned Run Average (ERA). An ERA is calculated by multiplying 9 by…
A: In this problem, we need to design the code in the java Script programming language. Input - Two…
Q: Question 1) Create a Python program called "test3_firstname_latename" with 2 function calls in the…
A: code :-- # function to add the * at right position for valid expressiondef add_star(exp): # for…
Q: Que: Write a function to convert temperature from Fahrenheit to Celsius named “ConvertFtoC” that…
A: Program For the Above Problem #include <stdio.h>void ConvertFtoC(double fahrenheit){double…
Q: Test Average and Grade Write a program that asks the user to enter five test scores. The program…
A: An algorithm A complete Python Program (including documentation) Output
Q: Many people do not use capital letters correctly especially when typing on small devices like smart…
A: ** you have not specified any language, so i chose c++. #include…
Q: Send the age of each family member to a function called average (), where the average is after…
A: When we create a local variable it is allocated on the stack and is therefore unavailable once the…
Q: Presentation exercise 6 Write a function called num_of_digits which takes as input an integer and…
A: I have provided the answer based on Python Programming. Detailed comments are included for a better…
Q: You are creating a function that manipulates a number. The function has the following requirements:…
A: Suppose we have number like 2.35 or 3.78 Using the function described, the answer should be 2 or 4.…
Q: Create a code in VBA EXCEL, setting up a function that receives a positive integer "a" and returns 1…
A: Required: Create a code in VBA EXCEL, setting up a function that receives a positive integer "a" and…
Q: A palindromic prime is a prime number and also palindromic. Example, 131 is a prime and alse…
A: Solution :
Q: Assignment Use the asterisk diamond program and create a function diamond (.) that takes two values,…
A: Given : Create Function Diamond using this function we will print Diamonds.
Q: Create a function that returns an Earned Run Average (ERA). An ERA is calculated by multiplying 9 by…
A: We need to write a Javascript code for the given scenario.
Q: 3) A function called isMagic is written below, your task is to write two of the helper functions…
A: Given:
Q: 10.) Write a function, is_prime, which takes a single integer argument and returns prime number and…
A: Given: To write a python function is_prime which returns true when a argument is prime otherwise…
Q: Please, remember to participate in this discussion; post at least once, and respond to at least two…
A: Answer: First, write the function return type Then write the function name And Inside parenthesis()…
Q: HOMEWORK 6 PART 1 Date Due: Wednesday, April 14, 2021 at 11:59pm Complete a program that allows the…
A: A function is a sub-program that is called from the main function to execute. Read the choice from…
Q: Create a function that takes three arguments prob, prize, pay and returns true if prob * prize >…
A: This C++ program has a user defined function with name profitableGamble().
Q: The caret, when found at the start of a character set, is the equivalent to "not" in RegEx. The…
A: Regular expression that matches any character except letters, digits and spaces code written in…
Q: Explain 7kyu Square Every Digit 1818315 90% of 20,64970,162 of 196,097 Mysterious Magenta A 1 Issues…
A: Answer: Algorithms: Steps1:we have create a function name as square_digits that taken an arguments…
Q: 3) A function called isMagic is written below, your task is to write two of the helper functions…
A: Answer :
Q: Write a c# function that calculates body mass index. This function should accept weight and height…
A: using System;class HelloWorld { static void Main() { Console.WriteLine("B.M.I. Calculator - ");…
Q: Use the Design Recipe to write a function called which_day that consumes an int representing the…
A: The solution to this problem is given in step2
Q: 3) A function called isMagic is written below, your task is to write two of the helper functions…
A: C++ program is given Below
Q: Date Due: Wednesday, April 14, 2021 at 11:59pm addition subtraction getChoice Complete a program…
A: Actually, c++ is a powerful general purpose language. It is a high level language.
Q: *6.7 (Financial application: compute the future investment value) Write a function that computes…
A: //SOURCE CODE IN JAVA import java.util.*; import java.util.Scanner; class FutureInvestmentValue {…
Q: (2) jlkäi If you have the following function in Mat lab, the function can be drawn using the…
A: Here, I have to choose the option for the above question.
Q: The factorial n! of a positive number (integer) is defined by n! = n · (n – 1) · (n – 2 ) ...- 3·…
A: Firstly, create a file with name - B000000_P6_fact.m and, paste the below given Program code: %…
Q: a) Complete the following void function named ExchangeValues to exchangetwo integers by filling…
A: The problem is based on function creation and calling of functions.
Q: Create a function that takes a number as an argument and returns "Fizz", "Buzz" Or "FizzBuzz" If the…
A: In this problem, we need to design the code in the Python programming language. Input - Integer…
Q: Create a function that determines whether each seat can "see" the front-stage. A number can "see"…
A: In this question we need to implement a function to check whether every person can see the…
Q: 4. (Prime Numbers) An integer is said to be prime if it is divisible by only 1 and itself. For…
A: Below is the required C++ program: - Approach: - Importing the header file and the namespace.…
Q: “Days Into Year (C++)” By using my code (photo is attached), implement a Days Into Year function.…
A: A date has to be taken from user in the required format. A function that returns how many days we…
Q: Create a function that takes a number as an argument and returns "Fizz", "Buzz" or "FizzBuzz" • • •…
A: In this problem, we need to design the code in the Python programming language. Input - Integer…
Q: Create an inner function to calculate the addition in the following way, Create an outer function…
A: Program Plan: Define an outer function that accepts x and y Define an inner function that also…
Q: The caret^. when found at the start of a character set, is the equivalent to "not" in RegEx. The…
A: Here i write code to check according the question: code: import re txt = " alice15@gmail.com " x =…
Q: Create a function that takes a number as an argument and returns "Fizz", "Buzz" or "FizzBuzz" • If…
A: Algorithm - Take input from user. Now use the below logic - if num % 3 == 0 and num % 5 == 0:…
Q: The caret, when found at the start of a character set, is the equivalent to "not" in RegEx. The…
A: In this problem, we need to design the code in the Python programming language. Input - String…
Q: struct Quaternion { float x, y, z, w; }; struct AABB { Vec3 min, max; };
A: Using c++ write the function to find if target is visible to the camera, you may create and use…
Q: Create a function that returns an Earned Run Average (ERA). An ERA is calculated by multiplying 9 by…
A: In this problem, we need to design the code in the java Script programming language. Input - Two…
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- Declare and define a function that computes bonus for an employee depending on the base salary and the number of years of experience of the employee. Inside the function, check the number of years of experience. If the number of years of experience is greater than 10 years, the bonus is 10% of the base salary, otherwise it is 5% of the base salary. You will need to call this function from your main function and pass the base salary and the number of years as arguments. Code: #include <iostream>using namespace std; double compute_bonus(double base_salary, int experience); int main(){ double base_salary; int experience; //get values of base_salary //get experience from user //call compute_bonus by passing necessary parameters //display the bonus returned by the function return 0;} //function definition{ double bonus; //compare experience/calculate bonus //return computed bonus }A bank charges $10 per month, plus the following check fees for a commercial checking account: $0.10 each for less than 20 checks $0.08 each for 20 through 39 checks $0.06 each for 40 through 59 checks $0.04 each for 60 or more checks Write a function BankCharges() that allows the user to enter the number of checks written and computes and displays the bank’s service fees for the month. All checks for the month are assigned the same charge, based on the total number of checks written during the month. Use the following test data to determine whether the application is calculating properly. In each case, the customer is charged only a single rate, based on the total number of checks. Your solution should clearly show the function. Customer Number of Checks Bank Charges Nancy 15 Lilian 25 Arianna 45 Ben 75Python question please include all steps and screenshot of code. Also please provide a docstring, and comments throughout the code, and test the given examples below. Thanks. Write a function diceprob() that takes a possible result r of a roll of pair of dice (i.e. aninteger between 2 and 12) and simulates repeated rolls of a pair of dice until 100 rolls of rhave been obtained. Your function should print how many rolls it took to obtain 100 rollsof r.>>> diceprob(2)It took 4007 rolls to get 100 rolls of 2>>> diceprob(3)It took 1762 rolls to get 100 rolls of 3>>> diceprob(4)It took 1058 rolls to get 100 rolls of 4>>> diceprob(5)It took 1075 rolls to get 100 rolls of 5>>> diceprob(6)It took 760 rolls to get 100 rolls of 6>>> diceprob(7)It took 560 rolls to get 100 rolls of 7
- change.py Create a program, change.py, that has a function that takes 5 arguments thatcorrespond to the number of $1 dollar bills, quarters, dimes, nickels, andpennies, respectively. Calculate the total value of that change, and print "Thetotal value of your change is $x" where x is equal to the total value.A county collects property taxes on the assessment value of property, which is 60 percent of the property’s actual value. For example, if an acre of land is valued at $10,000, its assessment value is $6,000. The property tax is then 72¢ for each $100 of the assessment value. The tax for the acre assessed at $6,000 will be $38.40. Write a function that accepts the actual value of a piece of property and displays the assessment value and property tax. JavaScriptCreate a function called midvalue that accepts three distinct int values as input and returns the value that is located exactly in the centre of the three. Thus, midvalue(5,28,14) yields 14.
- fast please in pyth 10. Write a complete function. The name of the function is priceGuide, it has a single input parameter called avgPrice, and it has no return. The function is used to determine how expensive restaurants are, based on their average meal price (you can assume that the price is always larger than zero). If the average price is $10 or less, print the message “Inexpensive”. If the price is more than $10 but less than or equal to $30, print the message “Moderate”. If the price is more than $30, print the message “Pricey”. 9. Write a for loop to print all the even numbers contained in the range of 2 to 20, inclusive.#include using namespace std; /*complete the function to multiple the megabytes, don't forget to set the parameter*/ void promotion() { //taking multiplier as input int multiplier; cin>>multiplier; } int main() { //getting initial count of megabytes int megabytes; cin >> megabytes; //printing the count of megabytes before the promotion cout << "Before the promotion: " << megabytes << endl; //complete the function call promotion(); //printing the count of megabytes after the promotion cout << "After the promotion: " << megabytes << endl; return 0; }Que: Write a function to convert temperature from Fahrenheit to Celsius named “ConvertFtoC” that takes one double value for Fahrenheit as argument, and returns the equivalent temperature in Celsius(type double). Create a program that exercise this function by obtaining a Fahrenheit value from the user, calling the function, and displaying the value of Celsius it returns. [Formula: Celsius = (Fahrenheit – 32 ) * 5/9 ] note: use C language
- In physics, an object that is in motion is said to have kinetic energy. The following formula can be used to determine a moving object’s kinetic energy:KE=12mv2The variables in the formula are as follows: KE is the kinetic energy, m is the object’s mass in kilograms, and v is the object’s velocity in meters per second. Write a function named kinetic_energy that accepts an object’s mass (in kilograms) and velocity (in meters per second) as arguments. The function should return the amount of kinetic energy that the object has. Write a program that asks the user to enter values for mass andvelocity, then calls the kinetic_energy function to get the object’s kinetic energy.Python question please include all steps and screenshot of code. Also please provide a docstring, and comments through the code, and test the given examples below. Thanks. Write function season() that takes as input the number of a month (1-12) and returnsthe season corresponding to the month, as a string. You may assume that numbers 1 to 3correspond to Winter, 4 to 6 correspond to Spring, 7 to 9 correspond to Summer, and 10to 12 correspond to Fall. If anything other than the integers 1 through 12 are entered theprogram should print the message ‘This is not a valid entrée’. Use a dictionary andexception handling.>>> season(3)'Winter'>>> season(11)'Fall'>>> season(0)This is not a valid entréeDefine a function hypotenuse that calculates the hypotenuse of a right triangle when the other two sides are given. The function should take two double arguments and return the hypotenuse as a double. You can use the sqrt function from the cmath library. Use this function in a program to determine the hypotenuse for each of the following triangles: Triangle Side 1 Side 2 1 3.0 4.0 2 5.0 12.0 3 8.0 15.0