Question: 2. Write a program that uses a void function which computes two roots of a quadratic equation using the formula given below. The function accepts

 2. Write a program that uses a void function which computes

2. Write a program that uses a void function which computes two roots of a quadratic equation using the formula given below. The function accepts three input parameters from main: a, b and There are two outputs from the function: root1 and root2 The formulae for root1 and root2 are as below: root1va 2a where d = (b2-4ac) Make sure to check the value of d before computing root1 and root2. If the value of d is negative, then display that roots are complex, otherwise use the two formulae. Call this function properly from main. 3. Short Questions from Array a) b) c) d) You want to store the following decimal numbers into an array. Declare and initialize the array. Numbers to be stored are:3.4, 7.9,1.6, 25.2, 4.8 Now display the 3'o data using proper C++ statement using the array name you selected in part (a). Write suitable program segment to add all the numbers and store in Sum. Use a loop and the array name to do that. Write a function that can take the array and determine which one is the largest element of all the values in the array. Write a value return function that can be used to compute the compound interest based on the given formula: Total compounded interest P (1+r)(nt-p Where P is the principal loan amount r is the annual interest rate (decimal number) 4. no of times per year the interest is compounded (if monthly, them n will be 12) t number of years the loan is borrowed for. The function should return the total compound interest

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!