Question: Write a C + + program with the following specifications: Define a C + + function ( name it myfunction _ StudentID where StudentID is

Write a C++ program with the following specifications:
Define a C++ function (name it myfunction_StudentID where StudentID is your actual student ID number) that has two 2 integer inputs (N and M) and returns a double output S, where
S equals sum from n equals 1 to N of space sum from m equals 1 to M of space fraction numerator square root of m n end root plus e to the power of square root of m end exponent plus e to the power of square root of n end exponent over denominator m n plus 2 end fraction space space space space
(Note: in the actual quiz, do not expect a simple sum always, practice if-else, switch statements, for/while loops, other mathematical functions such as sin, cos, remainder, exponentiation, etc.).
In the main function,
Read user inputs for N and M from the command window (console), while ensuring that both and N and M 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.
Use the above function (myfunction_StudentID) to determine the sum S for the user inputs N and M. Display the result using 5 decimal values.
Using the above function and a for loop, display the values of S for M=10 and for N values from 1 to 10(1,2,3,..,10). Also, write the resulting values to a file named doublesum.txt. Display the result using 5 decimal values in all outputs (file and command windows).

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!