Write a program to read a score and assign a grade based on the following table:

Your program, in addition to the main function, must contain the following functions:
- A logical function wrongScore that receives a score and returns 1 if it is outside the range i.e. less than 0 or greater than 100. If the score is within the range, it will return 0.
- A function getScore that, using do-while and a call to the function wrongScore, will keep reading the score from the user until he enters a correct score. The correct score will be returned by the function.
- A function assignGrade that receives a score and returns a grade (A or B or C or D or F).
A sample execution of the program is shown below:

Question 2: (30 points)
Write a program that uses Taylor series expansion to compute
as shown below:

Write a function taylorexp to compute the approximate value of
based on 2 input arguments; the value of x and the number of terms to include in the summation.
In the main function, your program will use a loop to compute the approximate value of
by calling taylorexp. The loop will stop when the percentage error is less than 0.1 percent.

The factorial can be computed in the loop or use the factorial function defined in the slides but make the rerun type double or long.
A sample run of your program is shown below:

Question 3: (40 points)
Create a text file "observations.txt" to contain an unknown number of observations (in floating point), then write a program that uses a function named 'statistics' which takes the address of "observations.txt" as an input and returns 4 values; the max, min, count, and range of these observations.
From the main function, print all returned values on the screen.
Note: range = max – min
Read the first value before the loop and initialize your max, and min variables with this first value. Then while you read the remaining values, update you max variable once you find a new value larger than your max and update your min variable once you find a new value smaller than your min.
بـ صراحة حاولت بـ الاول عدة محاولات لكن للاسف ماعرفت طريقة عمل الفانكشن ! . . والسؤال الثاني لم افهم فكرته . . اما الثالث فـ لا اعرف من الاساس كيفية فتح ملف txt من C++ . .
وشاكر لكم ومقدر . .
