Question: 1. Write C++ function called evaluate_quadratic_function. This function should take four numerical parameters. The first three parameters represent the coefficients of the quadratic function and

1. Write C++ function called evaluate_quadratic_function. This function should take four numerical parameters. The first three parameters represent the coefficients of the quadratic function and the fourth parameter represents the value of x. The function should compute and return the value of that quadratic function for given x. For those who forgot their algebra, a quadratic function ahs a form y = ax^2 + bx + c and your C++ function should compute y given a, b, c (these are the coefficients of the quadratic function) and d. 2. Write C++ function average_sequence that will take three parameters, the first two parameters are real numbers and the third parameter should be a positive integer. The function should take the first two parameters and compute a sequence of numbers in which the next number is the average of the previous two. For example, if the two input numbers are 0 and 1 the sequence should be 0, 1, 0.5, 0.75, 0.625 ... the third value is 0.5 since this is the average of 0 and 1, the fourth value is 0.75 since this is the average of 1 and 0.5 and so on. The evaluation should stop when the function computes n-th element in the sequence, where n is the value of the third function parameter. The function should return the nth value in the sequence. For example the function call average_sequence(0, 1, 5) should return 0.625 since this is the fifth value in the sequence (computed above).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!