Question: Problem1: Write C++ code that sum the numbers from 1 to 100 Problem2: a. Write C++ code that sum reciprocals (1/1 + 1/2 + +
Problem1: Write C++ code that sum the numbers from 1 to 100
Problem2: a. Write C++ code that sum reciprocals (1/1 + 1/2 + + 1/99 + 1/100) b. Write C++ code that sum reciprocals (1/100 + 1/99 + ... 1/2 + 1/1) compare a and b
Problem3: a. Write C++ code that sum multiplication reciprocals (1/(1x1) + 1/(2x2) + ) b. Write C++ code that sum reciprocals (1/(100x100) + 1/(99x99) + ... )
complete the code
| #include "functionSum.h" | |
| using namespace std; | |
| /* | |
| Problem1: | |
| ========= | |
| Write C++ code that sum the numbers from 1 to 100 | |
| Problem2: | |
| ========= | |
| a. Write C++ code that sum reciprocals (1/1 + 1/2 + + 1/99 + 1/100) | |
| b. Write C++ code that sum reciprocals (1/100 + 1/99 + ... 1/2 + 1/1) | |
| compare a and b | |
| Problem3: | |
| ========= | |
| a. Write C++ code that sum multiplication reciprocals (1/1*1 + 1/2*2 + ) \ | |
| b. Write C++ code that sum reciprocals (1/100*100 + 1/99*99 + ... ) | |
| */ | |
| int sumUpTo(int x) { | |
| //write your code here | |
| } | |
| float sumReciprocalNormal(int x) { | |
| //write your code here | |
| } | |
| float sumReciprocalRev(int x) { | |
| //write your code here | |
| } | |
| float sumMysteryNormal(int x){ | |
| //write your code here | |
| } | |
| float sumMysteryRev(int x) { | |
| //write your code here | |
| } |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
