Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain the factors influencing wage and salary administration.

Answered: 1 week ago

Question

Examine various types of executive compensation plans.

Answered: 1 week ago

Question

1. What is the meaning and definition of banks ?

Answered: 1 week ago