Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: Max, Min, Average of Number String

1. ## Max, Min, Average of Number String

hey guys. i have several problems but i stuck with these 2 problems. hope you guys can help me out.

1- write a C++ program that reads in an unspecified quantity of real numbers, of quantity < 100, and stops reading them in when the user inputs a character that you tell them to. The program then reports the exact quantity of numbers read in, their minimum, maximum, and average. Report at least 5 different runs of input sets. EX
please enter numbers one at a time, pressing return after each one. when you want to stop, just enter 0 ( a zero)
15.1
176.6
2066.4
97.2
0

thank you.
you entered 4 numbers
the largest number is 2066.4, smallest is 15.1, the average is 58.825

2- Pi Estimation with Arctan:
Equation 1: pi/4 = 1-1/3 + 1/5 - 1/7 + 1/9 - ...
which come from the series
arctan(x) = x - x^3/3 + x^5/5 - x^7/7 + x^9/9 - ... by letting x = 1.0
however, rearranging the series produces a different looking equation:
Equation 2: pi/8 = 1/(1x3) + 1/(5x7) + 1/(9x11) + ...
which equation converges on a value of pi faster? write a c++ program that uses both equations 1 and 2, separately, showing how the value of pi changes as each term is added up to 50 terms. Identify which equation converges faster. write the output to an external file instead of to the screen.

any help would be really helpful especially #2.
thank you

• This looks like classic homework.

• Well what are you stuck on? What are your specific questions? What are you unsure about?

• i got it guys. thanks oracle

how come i can't edit my original post?

• Originally Posted by truviet911
i got it guys. thanks oracle

how come i can't edit my original post?
Because it has been more than 2 days, why would you need to edit anyways? If you want to mark it resolved, it should still let you do that.

•

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•