Write a function named calcDiscount that calculates the discount on purchases from an on-line pants store.
Q: Question 4) Write a user defined function called NumSolutions that determines the number of…
A: The function will be a void function as it doesn't return anything Inside the function all the logic…
Q: Question 3 The Fast Freight Shipping Company charges the following rates: Weight of Package (in…
A: Here we have a function calculateCharge() which will require two input parameters and out return…
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: C++ code please Write a program that defines the named constant PI, const double PI = 3.14159;,…
A: Purpose of the program: This program determines the square root of the constant value "PI". Again,…
Q: Code / Write a function named calcDiscount that calculates the discount on purchases from an…
A: Objective: A function should be written named "calcDiscount" to compute the discount on purchases…
Q: 4. You want to order Burger from Chillox through the FoodPanda App. You have to calculate the total…
A: Given formula: Total price = meal_cost + delivery_charge + tax How total price is calculated: ('Beef…
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: The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour…
A: Conditional Statement in Programming: In programming, conditional or decision-making statements can…
Q: You will create a program to print the lyrics of one of the songs below. Your program will define…
A: #include<iostream> using namespace std; void Chorus() { cout<<"\nOld MacDonald had a…
Q: Programming question. In the textbox below, write the definition for the friend function declared on…
A: Answer The friend function on line 4 is working to let you read and write data to stream objects.…
Q: The Middletown Wholesale Copper Wire Company sells spools of copper wiring for $100 each and ships…
A: Program in c language
Q: The Middletown Wholesale Copper Wire Company sells spools of copper wiring for $100 each and ships…
A: The Middletown Wholesale Copper Wire Company sells spools ofcopper wiring for $100 each and ships…
Q: this question: You are not allowed to use any of the functions from . Also, you are not allowed to…
A: Below is the required C program: - Approach: - Include the header file. Declare the global…
Q: Function 2: Calculate Remainder function _two (dividend, divisor) Create a JavaScript function that…
A: Hello student Greetings Hope you are doing great. As per our company's guidelines, in case of…
Q: Z Bank wants you to create a simple python program for calculating interest rate and Total balance…
A: #include <stdio.h> void main(){ //printf("Hello World"); func(); } void func(){…
Q: Hello, I needed help with this JavaScript function Thanks. function _three(radius, height) Create a…
A: logic:- define function taking radius and height Return 3.14156*radius*radius*height use…
Q: Function 3: Volume of Cylinder function _three (radius, height) Create a JavaScript function that…
A:
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: 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: C++
A: //import the required header file #include <iostream> using namespace std; //declare the…
Q: Given a function definition def calc_val(a, b, c): what value is assigned to b during this function…
A: Q) what val assign to b during this function call calc_val(42, 55, 77) Ans: 55
Q: 3) A function called isMagic is written below, your task is to write two of the helper functions…
A: Given:
Q: Question 2 ( : Write a function named lucky3Game that lets the user bet on 5 dice rolls win the bet…
A: Here I have created a new function named roll(). This function uses randint() method from the random…
Q: PROBLEM: Write a program which accepts a number corresponding to a plane figure: 1. Right Triangle…
A: C++ program to find the area perimeter and circumference of circle , Right angle triangle and…
Q: A bank charges $10 per month, plus the following check fees for a commercial checking account:…
A: I'm using Visual Basic programming to create the code & display the result. I hope this will be…
Q: PROBLEM: Write a program which accepts a number corresponding to a plane figure: 1. Right Triangle…
A: C++ program to find the area ,perimeter and circumference of Triangle ,Rectangle and Circle
Q: Rewrite your pay computation with time-and-a-half for overtime and create a function called…
A: Program screenshot in python:
Q: 3) A function called isMagic is written below, your task is to write two of the helper functions…
A: Answer :
Q: 2. Create a function called GET_ANNUAL_COMP to return the annual salary computed from an employee's…
A: Solution Q. a) 1. SQL code- CREATE OR REPLACE FUNCTION GET_ANNUAL_COMP(p_sal IN…
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: 3. Factorial a) Define a function named factorial() with a parameter n. This function returns the…
A: Given that, Factorial a) Define a function named factorial() with a parameter n. This function…
Q: Question 2) The NOAA has asked you to write a program implementing the following decision table to…
A: /*C program to implement hurricane function that takes a wind speed parameter and display wind…
Q: The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour…
A: #include<stdio.h> #include<conio.h> int charge(int power){ if(power <= 300) return…
Q: I'm trying to create a function to count the mortgage
A: It can be because you made it too complex. Simply define the equations to make them simpler. You can…
Q: ????????: Assume on a planet called "Chocolatey", 1 month = 20 days and 1 year = 240 days = 12…
A: import java.util.Scanner;public class Main { public static void main(String[] args) {…
Q: Hello I needed help with this JavaScript function Thanks. function _two(dividend, divisor) Create a…
A: Please try on a web browser , i am attaching the code with output, I am promting user to give two…
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: Create a function named fnTuition that calculates the tuition for a student. This function accepts…
A: Answer
Q: 3. Factorial a) Define a function named factorial() with a parameter n. This function returns the…
A: Code: def factorial(n): if n == 1: return n return n*factorial(n-1) n =…
Q: Procedure 3. – Define a function named procedure3() that will be called from main() function, the…
A:
Q: Write a set of functions that calculate the cost of movie tickets for a family. These functions…
A: Step 1 : Start Step 2 : Define a Function calc_RunningTotal() to calculate the running_total after…
Q: Write a function called power to raise a to the b power and test it to verify the same answer as…
A: Algorithm:- define power(a,b) set sum=1; for(int i=1;i<=b;i++) { sum=sum*a; }…
Q: QUESTION 1 PROBLEM: Write a program which accepts a number corresponding to a plane figure: 1. Right…
A: C++ program to find the area ,perimeter and circumference of Circle ,Traingle and Rectangle
Q: Write a function named Quotient with 2 Integer parameters (originally from text boxes) and a Double…
A: CODE IN JAVA : import java.util.Scanner; public class Divison { //This method divides first…
Q: Assume a function F1 is defined with the heading: int F1(int a, double &b, double t] ); Assume the…
A:
Q: Write a function called between that has two parameter values: start and stop. The function should…
A: Note : Function is given in java programming language.
Q: Program 3: Write functions with default argument for addition, multiplication and division of two…
A: The given scenario needs a program using function overloading approach of OOPS. The given scenario…
Q: 2. Create a function called GET_ANNUAL_COMP to return the annual salary computed from an employee's…
A: Given:
Code / Write a function named calcDiscount that calculates the discount on purchases from an on-line pants store.
All pants on the site sell for $20. Quantity discounts are given as follows:
Quantity Discount 1-9 none, 10-19 12%, 20-49 23%, 50-99 34%, 100 or more 45%.
Your function should accept the number of pants purchased as an argument and return the total cost after the discount.
Make sure returned value is formatted to *2* decimal places, as currency is normally displayed.
in python
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Code / Write a function named calcDiscount that calculates the discount on purchases from an on-line pants store. All pants on the site sell for $20. Quantity discounts are given as follows: Quantity Discount 1-9 none, 10-19 12%, 20-49 23%, 50-99 34%, 100 or more 45%. Your function should accept the number of pants purchased as an argument and return the total cost after the discount. Make sure returned value is formatted to *2* decimal places, as currency is normally displayed. Note: you are not writing a full program for this question. Just write the function as specified. It's OK to use IDLE/PyCharm to test your solution.Create a function named fnTuition that calculates the tuition for a student. This function accepts one parameter, the student ID, and it calls the fnStudentUnits function that you created in task 2. The tuition value for the student calculated according to the following pseudocode: if (student does not exist) or (student units = 0) tuition = 0 else if (student units >= 9) tuition = (full time cost) + (student units) * (per unit cost) else tuition = (part time cost) + (student units) * (per unit cost) Retrieve values of FullTimeCost, PartTimeCost, and PerUnitCost from table Tuition. If there is no student with the ID passed to the function, the function should return -1. Code two tests: 1) a student who has < 9 student units, and 2) for a student who has >= 9 student units. For each test, display StudentID and the result returned by the function. Also, run supportive SELECT query or queries that prove the results to be correct.IN pyth coding please 13. Write a function called calcTotal. It should have a required parameter called price and an optional parameter called taxRate with a default value of 0.08. The function should return the total price including the calculated tax.
- Craps is a classic casino game in which players bet on the outcome of rolling 2 six dice (2d6). Write a function that takes a dice configuration, and a numeric value as input. The function should then calculate the probabilityof rolling a series of numbers on the dice that matches or exceeds the input value (ie. ‘1d6’, 3, would return 4/6). You can use a stats based or a numeric approach.a) ‘2d6’, 7b) ‘2d6’, 9c) ‘3d8’, 22d) ‘1d20’, 17e) 6, 5PROBLEM: Write a program which accepts a number corresponding to a plane figure: 1. Right Triangle 2. Rectangle 3. Circle USE C++The program will then ask for the following: base and height – if the previous input is 1 (right triangle) width and length – if the previous input is 2 (rectangle) radius – if the previous input is 3 (circle) The program should exit if the input is not 1,2 or 3. SPECIFICATIONS: Develop the following functions: Create a function named getTriangleArea which accepts the base and the height and returns the area of the right triangle. Create a function named getTrianglePerimeter which accepts the base and the height and returns the perimeter of the right triangle. Create a function named getRectangleArea which accepts the width and the length and returns the area of the rectangle. Create a function named getRectanglePerimeter which accepts the width and the length and returns the perimeter of the rectangle. Create a function named getCircleArea which…Create 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.
- ● Prompt a user to input numerical values. If a wrong value is given, prompt the user again until a correct value is provided. Numbers with decimal numbers should be accepted also.● Create a budget webpage that records income and expenses. Prompt the user to input as many entries as they can. Prompt the user first for income first and then expenses. Create a function that computes the average of all the income entries and displays the computed value on a div. Create another function for the average of all the expenses and display the computed value on anotherdiv.Note that since monetary values are being handled, display computed values in 2 decimal places. Output the average income using. The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour (kwh) for the first 300 kwh 8 cents per kwh for the next 300 kwh (up to 600 kwh) 6 cents per kwh for the next 400 kwh (up to 1,000 kwh) 5 cents per kwh for all electricity used over 1,000 kwh Write a function to compute the total charge for each customer. Write a main function to call the charge calculation function using the following data: Customer Number Kilowatt-hours Used 123 725 205 115 464 600 596 327 … … The program should print a three column chart listing the customer number, the kilowatt hours used, and the charge for each customer. The program should also compute and print the number of customers, the total kilowatt hours used, and the total charges.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.
- The Middletown Wholesale Copper Wire Company sells spools ofcopper wiring for $100 each and ships them for $10 apiece. Write aprogram that displays the status of an order. It should use twofunctions. The first function asks for the following data and storesthe input values in reference parameters.The number of spools ordered.The number of spools in stock.Any special shipping and handling charges (above the regular$10 rate).Create a function that will validate if given parameters are valid geographical coordinates.Valid coordinates look like the following: "23.32353342, -32.543534534". The return value should be either true or false.Latitude (which is first float) can be between 0 and 90, positive or negative. Longitude (which is second float) can be between 0 and 180, positive or negative.Coordinates can only contain digits, or one of the following symbols (including space after comma) -, .There should be no space between the minus "-" sign and the digit after it.Here are some valid coordinates:-23, 2543.91343345, 1434, -3And some invalid ones:23.234, - 23.4234N23.43345, E32.64576.325624, 43.34345.3450, 1,2"""# I'll be adding my attempt as well as my friend's solution (took us ~ 1 hour) # my attempt.Write functions with default argument for addition, multiplication and division of two numbers. For addition and multiplication the default values for two numbers will be 0. For division the default value for first and second arguments will be zero and one respectively. Use the above function for finding addition, multiplication and division when 1) No arguments are supplied, 2) First argument is 2 and second argument is not supplied, 3) Arguments are 9 and 3. E C:\Users\Faiga\Desktop\CP1\cp1\Debug\cpl.exe addit ion<> = 0 addit addition 9 n<2> 2 12 multi plication<> - 27 division<> - 0 divia ion<2> divis ion Press any key to continue