Write a function that would calculate an item's sale price based on the item's purchase price plus the tax. The function prototype is double Sale_Price (double, double). The first parameter is the purchase price and the second parameter is the tax. The function will return the sale price of the product. its formula is: Tax Amount= purchase price * (Tax Rate/100) The formula of calculating the final price of an item is: Sale Price = Purchase price + Tax Amount
Q: (Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: My Code is not getting the correct output. Here is the lab assignement : 1.27 LAB: Exact change -…
A: The code is def exact_change(user_total): num_quarters = user_total // 25 user_total %= 25…
Q: Code should be in Python, please Toll roads have different fees based on the time of day and on…
A: Given that, Toll roads have different fees based on the time of day and on weekends. calc_toll()…
Q: (Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for…
A: Hey there, I am writing the required solution based on the above given question. Please do find the…
Q: I need a C++ program that does the following: Write a program that computes and displays the…
A: The given problem is to be solved in C++ where the program will ask the vehicle details. Based on…
Q: In mathematics, a factorial of a number is calculated by multiplying that number by all of the…
A: I have written the code below:
Q: c++. Write a function that computes the average and standard deviation of four scores. The standard…
A: Functions for calculating the average and standard deviation are being forward declared. Declare and…
Q: In the U.S. fuel efficiency of cars is specified in miles per gallon (mpg). In Europe it is often…
A: function Lkm = mpgToLpkm(mpg) % multipy by 0.425144 to get % get kmpl then divide 100 % by kmpl to…
Q: How can I write a Python Program that Writes a custom function that assigns these rates to properly…
A: The program should: prompt you for the selling price, front-end profit, and back-end profit for the…
Q: Write a program that allows the user to enter the last names of five candidates in a local election…
A: Programs: Programs contain a set of instructions, to perform certain tasks. The instructions are…
Q: You are writing a program to calculate the average overall scores for two divers in a diving…
A: Please find the java program using the function in C++ without using the array.
Q: Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for…
A: #include<stdio.h> float round_money(float x) //function to round real number to 2 decimal…
Q: Write a C program that asks the user to enter an iPhone 6 wholesale cost and its markup percentage.…
A: #include <stdio.h> double retailPrice(double wholesalePrice, double markupPercentage){…
Q: Write a split_check function that returns the amount that each diner must pay to cover the cost of…
A: We need to provide definition of function split_check function that returns the amount that each…
Q: Write a function max_magnitude() with three integer parameters that returns the largest magnitude…
A: PYTHON code for above : def max_magnitude(user_val1, user_val2, user_val3): res =…
Q: Change this question to work using a function. decide what the name of the function of each should…
A: Here I have created a user-defined function named grossPay(). This function takes 2 arguments as…
Q: Write a program that accepts as input a number indicating the number of laps a runner walked around…
A: Step 1 : Start Step 2 : Define the function laps2miles() which accepts the number of Laps as…
Q: The new coordinates of a point in the x y plane that is rotated about the z axis at an angle…
A: ANSWER: I have provided the properly commented code in both text and image format so you can easily…
Q: Write a program that allows the user to enter the last names of five candidates in a local election…
A: Algorithm: Start Read last name of votes of five candidates Find sum of all votes Find percentage…
Q: In Coral Please Write a program whose inputs are three integers, and whose outputs are the largest…
A: A Coral program is as follows, Function LargestNumber(integer num1, integer num2, integer num3)…
Q: In mathematics, a factorial of a number is calculated by multiplying that number by all of the…
A: The programming language is missing in the question, the below answer is provided in C language. If…
Q: A company named ABC hired three employees in different years; each employee gets an increment of…
A: Program approach:- Using the necessary header file. Structure to store employee data. Char array to…
Q: The program has 2 inputs: miles_per_gallon and dollars_per_gallon. The function has 3 parameters:…
A: Cost for driven_miles = (driven_miles/miles_per_gallon) * dollars_per_gallon
Q: (Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for…
A: The complete code is given below .
Q: Write a program that takes as input your gross salary and your total saving and uses another…
A: import java.util.*; public class Main{ public static void main(String[] args) {…
Q: Write a split_check function that returns the amount that each diner must pay to cover the cost of…
A: According to the information given:- we have to create a split_check function to divide the dinner…
Q: Write a function that takes two numbers are parameters and returns their product. Create a program…
A: C++ used to answer this question
Q: You are writing a program to calculate the average overall scores for two divers in a diving…
A: The code implementation is given below.
Q: Write a program that allows the user to enter the last names of five candidates in a local election…
A: PROGRAM: //Header files #include <iostream> #include <string> #include <iomanip>…
Q: Toll roads have different fees based on the time of day and on weekends. Write a function…
A: Here I have created a function named calc_toll(). In this function, I have used a nested if-else…
Q: Write a program that takes input two numbers for and store it in two variables named gross_salary…
A: if (saving < 100000) { taxable_income = sal+saving; } else { taxable_income =…
Q: Write a python program that accepts name of an employee and employee's yearly sales of last five…
A: Required:
Q: Write a function which will take 1 argument, number of days. Your first task is to take the number…
A: """Program to calculate total number of years, months and days forgiven number of days""" #function…
Q: Write a program that does the following: • Read in a height in feet and inches (feet should be an…
A: CPP is a general-purpose programming language created by BS as an extension of the C programming…
Q: Write a function called factorial that computes the factorial of a given number x passed in as an…
A:
Q: Create a simple program that calls a function call gradeCalculated, in the main area the user is…
A: Program code: #define a function gradeCalculated def gradeCalculated(score): #if score less than 60…
Q: Write a program with an additional function called subtract2Function. Your main function will ask…
A: Introduction of the program: The C++ program takes an integer from the user as input and then the…
Q: Write a python program that accepts name of an employee and employee's yearly sales of last five…
A: Algorithm : main function Step 1 : asking for the number of employees n. Step 2 : declaring all the…
Q: Write a program that asks the user to enter an item’s wholesale cost and its markup percentage. It…
A: PROGRAM CODE: #include <iostream>#include <iomanip>using namespace std; // function…
Q: Write a function that receives a positive integer n as a parameter, then it must calculate the sum…
A: There is no specific language mentioned used c++ algorithm step 1: start step 2: create a function…
Q: Toll roads have different fees based on the time of day and on weekends. Write a function…
A: Given Toll roads have different fees based on the time of day and on weekends. Write a function…
Q: Write a main function that performs the following: • Prompts user to enter 2 integer values A and B.…
A: The program for the given problem is solved by using C programming language. Algorithm: The…
Q: Question: The polar coordinates r and 0 of a point (x, y) in the plane can be computed as follows:…
A: #include<stdio.h> #include<math.h> void polar(float,float); int main(void) {…
Q: include coding matlab , Give the user the option to stimulate the projectile motion on four…
A: According to the information given:- We have to stimulate the projectile motion. in matlab on the…
Q: Instructions 1 import math 2 def volume_cylinder(diameter, langth) radius - diameter / 2 calculate…
A:
Q: Change this question to work using a function. decide what the name of the function of each should…
A: def calculate(rate,hours): pay = rate*hours #Calculate pay and return the value return pay…
Q: *Write a program to calculate your costs for attending college UnitCost= $31 per unit 1) Input -…
A: The, code has given below;
Q: Write a program that does the following: • Read in a height in feet and inches (feet should be an…
A: #include <iostream> using namespace std;//name of variables in function prototype intFeet and…
Q: The following program will prompt the user for a starting number and an // ending number. Assume…
A: Programming instructions: Prompt the user to take inputs and store them in the variables. Calculate…
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Write a program that takes as input five numbers and outputs the mean (average) and standard deviation of the numbers. If the numbers are x1,x2,x3,x4,andx5, then the mean is x=(x1+x2+x3+x4+x5)/5 and the standard deviation is: s=(x1x)2+(x2x)2+(x3x)2+(x4x2)+(x5x2)5 Your program must contain at least the following functions: a function that calculates and returns the mean and a function that calculates the standard deviation.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 =…Engineers often measure the ratio of two power measurements in decibels, or dB, which can be calculated as follows:dB= log10P2/P1Where P2 is the power level being measured, and P1 is some reference power level. Write a function that calculates the level. The function’s prototype is as follows:double dBCalculator (double P1, double P2);Then, call dBCalculator from the main function to find the power ratio for the measurements from 1 to 20 Watts, in 2 Watt steps. You can assume that the reference power P1 is 1 Watt.
- In python, write a function that receives three parameters: name, weight, and height. The default value for name is James. The function calculates the BMI and returns it. BMI is: weight/(height^2). Weight should be in kg and height should be in meters. For instance, if the weight is 60 kg and the height is 1.7 m, then the BMI should be 20.76. The function should print the name and BMI. The function should return 'BMI is greater than 22' if the MBI is greater than or equal to 22. Otherwise, the function should return 'BMI is less than 22'. Call the function and print its output.Write a program that asks the user to input a grade that he or she received on an exam. The grade is an integer between 0 and 100 inclusive. The program should convert the numeric grade into the equivalent letter grade. Do the conversion by using a function Letter_Grade () that converts a numeric grade in the range 0 to 100 to the equivalent letter grade. The function should have one argument, the integer grade. The return value of the function should be A if the grade is 90 to 100; B if the grade is 80 to 89; C if the grade is 70 to 79; D if the grade is 65 to 69; and F if the grade is 64 or lower. After converting the grade, the program should display the nu¬meric grade and the equivalent letter grade.You are given a function called is_prime which consumes a positive number and returns True if the number is prime and False if the number is not prime. You do not need to write the is_prime function - it is already pre-defined. Your task is to use the Design Recipe to write a main function, that consumes no parameters, which prompts the user for a positive integer, n, and displays the first n primes. Your main function should call the is_prime function. Include a docstring!
- /*Write a program to calculate your costs for attending college UnitCost= $31 per unit 1) Input - to be done in main() Prompt the user for and input the number of units. Prompt the user for and input the amount for student fees. 2) Calculate the total (do not consider parking) Unit cost should be given as a # define. Must use a function to calculate the total. The function must have the following prototype (declaration).double calcTuition(double units, double studentFees); 3) Output the total amount. You must use a function to output the total. The function must have the following prototype (declaration). void output(double total); You must have your name both as a comment in the code and print it along with your student CWID # to the output. 4) Copy your output as a comment to the bottom of the source code. PreviousNext(Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for up to 10 hours of connection time. Additional hours or partial hours are charged at $1.99 each.Write a function charges that computes the total charge for a customer based on the number of hours of connection time used in a month. The function should also calculate the average cost per hour of the time used (rounded to the nearest 0.01), so use two output parameters to send back these results.You should write a second functionround_money that takes a real number as an input argument and returns as the function value the number rounded to two decimal places. Write a main function that takes data from an input file usage.txt and produces an output file charges.txt. The data file format is as follows:Line 1: current month and year as two integersOther lines: customer number (a five-digit number) and number of hours usedHere is a sample data file and the corresponding output file:Data file…(Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for up to 10 hours of connection time. Additional hours or partial hours are charged at $1.99 each. Write a function charges that computes the total charge for a customer based on the number of hours of connection time used in a month. The function should also calculate the average cost per hour of the time used (rounded to the nearest 0.01), so use two output parameters to send back these results. You should write a second function round_money that takes a real number as an input argument and returns as the function value the number rounded to two decimal places. Write a main function that takes data from an input file usage.txt and produces an output file charges.txt. The data file format is as follows: Line 1: current month and year as two integers Other lines: customer number (a five-digit number) and number of hours used Here is a sample data file and the corresponding output file:…
- (Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for up to 10 hours of connection time. Additional hours or partial hours are charged at $1.99 each. Write a function charges that computes the total charge for a customer based on the number of hours of connection time used in a month. The function should also calculate the average cost per hour of the time used (rounded to the nearest 0.01), so use two output parameters to send back these results. You should write a second function round_money that takes a real number as an input argument and returns as the function value the number rounded to two decimal places. Write a main function that takes data from an input file usage.txt and produces an output file charges.txt. The data file format is as follows: Line 1: current month and year as two integers Other lines: customer number (a five-digit number) and number of hours used Here is a sample data file and the corresponding output file:…Using Python, write an application that will calculate a loan payment. To complete this, you are required to write 2 functions, LoanPayment and InterestOnlyLoanPayment, as well as a test application that calls each of the functions to get the payment amount based on parameters supplied to the functions. The test application should output both the loan payment and the interest-only loan payment based on input values from the user. The LoanPayment function is defined as follows: Payment = Loan amount / Discount factor The discount factor is {[(1 + i)^n] - 1} / [i(1 + i)^n], where you have the following: n = Payments per year × Number of years i = Annual interest rate / Payments per year Take for example the following: D = {[(1 + 0.005)^360] – 1} / [0.005(1 + 0.005)^360] = 166.7916, where n = 12 × 30 and i = 0.06 / 12. Loan payment = $250,000 / 166.7916 = $1,498.88 The InterestOnlyLoanPayment is defined as follows: Interest-only payment = Loan amount × (Annual interest rate / 12) Take…Toll roads have different fees based on the time of day and on weekends. Write a function calc_toll() that has three parameters: the current hour of time (int), whether the time is morning (boolean), and whether the day is a weekend (boolean). The function returns the correct toll fee (float), based on the chart below. Weekday Tolls Before 7:00 am ($1.15) 7:00 am to 9:59 am ($2.95) 10:00 am to 2:59 pm ($1.90) 3:00 pm to 7:59 pm ($3.95) Starting 8:00 pm ($1.40) Weekend Tolls Before 7:00 am ($1.05) 7:00 am to 7:59 pm ($2.15) Starting 8:00 pm ($1.10) Ex: The function calls below, with the given arguments, will return the following toll fees: calc_toll(8, True, False) returns 2.95calc_toll(1, False, False) returns 1.90calc_toll(3, False, True) returns 2.15calc_toll(5, True, True) returns 1.05