Question: QUESTION 1 Write a C + + program with the following specifications: a . Define a C + + function ( name it myfunction _

QUESTION 1
Write a C++ program with the following specifications:
a. 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=n=1Nm=1Mmn2+em2+en2mn+2
(Note: in the actual quiz, do not expect a simple sum; practice if-else, switch statements, forwhile loops, other mathematical functions such as sin, cos, remainder, exponentiation, etc.).
b. In the main function,
i. Read user inputs for N and M from the command window (console) while ensuring that both 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 ) number until a valid number is entered.
ii. Use the above function (myfunction_StudentID) to determine the sum $ for the user inputs N and M. Display the result using 5 decimal values.
iii. 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,dots,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).
 QUESTION 1 Write a C++ program with the following specifications: a.

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!