Question 4) Write a user defined function called NumSolutions that determines the number of solutions from the quadratic formula. In order to determine number of solutions, you must calculate the discriminant. The formula to calculate the discriminant is: b2 – 4ac
Q: Write a function named times_ten. The function should accept an argument and display the product of…
A: Given: Write a function named times_ten. The function should accept an argument and display the…
Q: Write a C++ function to calculate the BMI of a person. (BMI = Mass / Height^2 ) where mass is in kg…
A:
Q: Question 4 C++ Functions [10] Write a C++ Program using functions which allows the user to input an…
A: Note: Comments mentioned in code for understandability. Code: #include<iostream> using…
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: Create a function that calculates the following mathematical expression: z = 3x' + +y* +eme) In(a
A: Logic:- we know that e(ln(x))=x but still I am implementing another function to find ln(x) sqrt…
Q: Write a function named times_five(). The times_five() function should accept a numeric argument and…
A: Given Function name times_five() And to do complete it.
Q: 3. Give the function header for each of the following functions a. Function hypotenuse that takes…
A: We are going to write function definition for the given functions asked in the question. First we…
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: QUESTION 2 Total interest amount = loan amount + (loan amount interest rate number of years) a)…
A: Answer: Algorithms: Step1: we have created function name as calcToInterest() and it takes three…
Q: Write a function named 'area' that accepts the base and height of a right-angled triangle as two…
A: PROGRAM INTRODUCTION: Take the value of base as input from the user. Take the value of height as…
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: A rocket is launched vertically. At time t= 0, the rocket's engine shuts down. At that time, the…
A: Code: time=0:0.5:30;heights=height(time); %bplot(time,heights) %c the rocket starts to fall%back…
Q: Please find the function that takes 2 numbers as parameters and calculates the sum of the numbers…
A: #include <stdio.h>#include <stdlib.h> int sumIterative(int,int);int…
Q: Question 4 The following function: rpad ('CIT', 5, '.'); would return: A) 'CIT...' ' B...CIT 'CIT..'…
A: 1) rpad function is used to padding the right side of a string with a specific set of characters.…
Q: Write a function named calcDiscount that calculates the discount on purchases from an on-line pants…
A: The given conditions can be applied using simple if-elif ladder
Q: Write a function that calculates:
A: As per the question statement, We need to write function which can calculate value of the given…
Q: use c++ to Write a function gcd that returns the greatest common divisor of two integers.
A: The largest integer which can perfectly divide two integers is known as GCD.The greatest common…
Q: When it is 8:00 in Lubbock, • It is 9:00 in New York • It is 14:00 in London • It is 15:00 in Cairo…
A: NOTE - I have coded using the python programming language. Here I have taken input from the user.…
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: 1)- The volume, V, of a cylinder is given by this formula: V=Pir?L | ris the cylinder's radius, and…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: PROBLEM #2: Create a function which solves for the surface area and volume of a sphere. Get a radius…
A: Python Code for computing surface are of sphere is in step 2.
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: Q #1. Write a user defined function 'maximum' to compute maximum of three numbers. Three numbers…
A: EXPLANATION - Create a program . In program create a main function . In main function declare four…
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: Procedure 2. - Define a function named procedure2 () that will be called from main () function, the…
A: #include <stdio.h> void procedure2(int N){ for(int i = 1; i <= N; i++) {…
Q: C) Assume that the main contains the definition of the following variables and/or constants: int…
A: According to the guidelines we are allowed to answer only the first question. - the question asked…
Q: Please define 4 variables and find the sum of these variables, the sum of the square of these, the…
A: The Java program is written where it reads a number from the user and prints the square, cube and…
Q: Define the function below: (note: no need to include main() only the definition of the function…
A: Step-2: Declare two variable r and xStep-3: Take input from user and store in xStep-4: Call function…
Q: Which function maps values between 0 and 1? * a) Sigmoid
A: Which function maps values between 0 and 1 ? The correct option is option a. Sigmoid
Q: When an object is falling because of gravity, the following formula can be used to determine the…
A: The program will be designed as follows: Define the function fallingDistance(). The function takes…
Q: A function that returns a float value should be declared as function Select one: O a void Ob…
A: 1. A function that returns a float value should be declared as ___ function 2. sqrt(225) Find the…
Q: Pass your marks of CA-1, CA-2 and CA-3 of course INT102 to the function with header high (float,…
A: Solution: Approach: Include necessary header files define the function high that takes ca1,ca2,ca3…
Q: Complete the following steps: Define a function called polys that takes 4 arguments x, a, b, and c…
A: 1) Below is Python program to define polys function, get coefficient from user and find min and max…
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: Use the Design Recipe to write a function called my_sum that consumes one parameter, assumed to be…
A: The python program obeys the following rubrics:Defining a function my_sum which accepts a parameter,…
Q: Q #1. Write a user defined function 'Area' to compute area of a circle. Radius of the circle will be…
A: C program: #include<stdio.h> //function to compute and return area of circlefloat Area(int r){…
Q: write c++ function named grade_avg that accept two floating point number (i.e grade1 and grade…
A: float grade_avg(float grade1, float grade2){ if(((grade1+grade2)/2)>0) { return ((grade1 +…
Q: Create a function called (Ysum) that find the value of y from following equation:
A: In this question, the value of y is to be calculated using this given expression. EXPLANATION:…
Q: What does the following statement do: (*max )( num1, num2, num3 ); is the prototype for function max…
A: (*max)(num1, num2, num3) is a call to the function pointed to by max
Q: Write a function that determines the number of days in the month of February. The function is…
A: Python is a high-level programming language, it runs on an interpreter system so it has a very fast…
Q: A function named cube_volume has already been defined. It consumes a float value and returns a float…
A: This is the syntax which is satisfying the above requirement return type…
Q: Write a function named area that accepts the base and perpendicular of a right-angled triangle as…
A: NOTE: SINCE THE LANGUAGE OF THE CODE IS NOT GIVEN, I HAVE USED PYTHON FOR THE SOLUTION. Define…
Q: Procedure 3. – Define a function named procedure3() that will be called from main() function, the…
A:
Q: One mile is 1.6 kilometers (for purposes of this question). Define a function miles_to_kilometers…
A: Required: Define a function miles_to_kilometers that consumes a distance in miles (a number) and…
Q: T = Tmean + (Tpeak – Tmean) Cos (w(t – tpeak)) here Tmean is the mean temperature over a year, Tpeak…
A: I am using MATLAB to plot as given in the question:
Q: Create a function that takes in top and bottom. You should return a random number between top and…
A: C++ used to answer this question
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: VBA EXCEL PROBLEM: Create a function that receives two positive integers a and b and returns ab.
A: The below program uses loop to count ab. In loop we will multiply a to itself, b times. Exit.
Q: 2. Create a function called GET_ANNUAL_COMP to return the annual salary computed from an employee's…
A: Given:
**C
*please provide comments
**Exo in picture
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
- Question 2 Write a function called power to raise a to the b power and test it to verify the same answer as Question 1. (Question 1 Assign the variable a to the number 5 and the variable b to the number 2. Raise a to the b power and print the result.)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 languageWrite a function named times_five(). The times_five() function should accept a numeric argument and display the product of its argument multiplied x 5. No return statement required.
- 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.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(Time in Seconds) Write a function that takes the time as three integer arguments (forhours, minutes, and seconds) and returns the number of seconds since the last time the clock “struck12.” Use this function to calculate the amount of time in seconds between two times, both of whichare within one 12-hour cycle of the clock
- 1.26 LAB: Swapping variables Define a function named swap_values that takes four integers as parameters and swaps the first with the second, and the third with the fourth values. Then write a main program that reads four integers from input, calls function swap_values() to swap the values, and prints the swapped values on a single line separated with spaces. Ex: If the input is: 3 8 2 4 function swap_values() returns and the main program outputs: 8 3 4 2 The program must define and call the following function. def swap_values(user_val1, user_val2, user_val3, user_val4) 1.26.1: LAB: Swapping variables 8 / 10 Load default template... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 def swap_values(user_val1, user_val2, user_val3, user_val4): user_val1,user_val2=user_val2,user_val1 user_val3,user_val4=user_val4,user_val3 returnuser_val1,user_val2,user_val3,user_val4 if__name__=='__main__': user_val1=int(input()) user_val2=int(input()) user_val3=int(input())…Write a function named times_ten. The function should accept an argument and display the product of its argument multiplied times 1Hi please Solve in c language. (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…
- Complete the following steps: Define a function called polys that takes 4 arguments x, a, b, and c and returns the value of a polynomial of the form ax3 + bx2 + cx. Next, prompt the user to enter the coefficients of the polynomial (see testing input below). Initialize x and assign initial values to variables named max_y and min_y by calling the function polysand passing the initial value of x and the user's input. Calculate the maximum and minimum values and their corresponding x-values over the interval [0, 20]. To accomplish this, create a while loop or a for loop to iterate over the values x = 0.1, 0.2, ..., 19.9, 20 and evaluate the function at each of these x-values (by calling polys) to determine the maximum and minimum function values. Create two formatted print statements that round the values to 2 decimal places and display the output shown below.Sample input and output are shown here Your input should look like this:Enter the coefficient of x^3: 1Enter the coefficient of…Hello,its incorrect it shows that: Error: Line: 17 Column: 1The statement is not inside any function. (It follows the END defined by the terminating function "MeanStD".)The prompt asks: Write a function that calculates the amount of money a person would earn over a period of years if his or her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should ask the user for the number of years and call the function which will return the total money earned in dollars and cents, not pennies. Assume there are 365 days in a year. function totalEarned(years) { } var yearsWorked = parseInt(prompt('How many years will you work for pennies a day? ')); alert('Over a total of ' + yearsWorked + ', you will have earned $' + totalEarned(yearsWorked));