1. Write a C++ program using a function called sum that calculates the following
summation:
\(F = \sum_{i=1}^{n} i^2 + 5\)
Where n is provided by the user in the main function. The function calculates the sum
and return it to the main function to display it.
2. Write a program that prompts the user for a positive integer N>1, then calls a function
called FACT_SUM to calculate the following sum.
\(R = \sum_{j=1}^{N-1} j!\)
Where j! = j(j - 1)(j - 2) ... 3x2x1
The function returns the sum to the main function to display it.
3. Engineers often measure the ratio of two power measurements in decibels, or dB,
which can be calculated as follows:
\(dB = \log_{10} \frac{P_2}{P_1}\)
Where \(P_2\) is the power level being measured, and \(P_1\) 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.