# Series C++

a): Define a C++ function that has two 2 integer inputs (N) and returns a double

output y, where y=∑sqrt(n+0.5)/(2n+1)

n=1

the value of n s'd be positive.

b): i):Read user inputs for N from the command window (console),

while ensuring N are positive (0) integers. If the

user enters non-positive numbers, the program should request the

user to re-enter a positive (0) number until a valid number is

entered.

ii). Use the above function to determine the value of y

for the user inputs N. Display the result using 3 decimal values.

iii):Using the above function and a for loop, display the values of y

for N values from 1 to 6 (1,2,3,..,6). Also write the

resulting values to a file named “output.txt”. Display the result

using 3 decimal values in all outputs (file and command windows).

output y, where y=∑sqrt(n+0.5)/(2n+1)

n=1

the value of n s'd be positive.

b): i):Read user inputs for N from the command window (console),

while ensuring N are positive (0) integers. If the

user enters non-positive numbers, the program should request the

user to re-enter a positive (0) number until a valid number is

entered.

ii). Use the above function to determine the value of y

for the user inputs N. Display the result using 3 decimal values.

iii):Using the above function and a for loop, display the values of y

for N values from 1 to 6 (1,2,3,..,6). Also write the

resulting values to a file named “output.txt”. Display the result

using 3 decimal values in all outputs (file and command windows).

You'll get 1 file (1.8KB)