Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help with while loop please B) Write a C++ program using a while loop to calcula

ID: 641753 • Letter: H

Question

Help with while loop please

B) Write a C++ program using a while loop to calculate the value of pi/2 accurate to 6 digits after the decimal point using the following series: Display the following and turn in printouts of the program and the results. The number of terms needed to find pi/2 . The value of pi/2 using acos(-1)/2 using 10 digits after the decimal point (for comparison). The value of pi/2 found with the series using 10 digits after the decimal point (the first 6 digits after the decimal point should match the value above).

Explanation / Answer

void menu4() //menu4() - Find the number of iterations to approximate Pi. { int counter=0,flag=0,digits; char series; long double pi1=0; long double result=0; long double pi12=0; long double ValuePi1=31; long double ValuePi2=314; long double ValuePi3=3141; long double ValuePi4=31415; long double ValuePi5=314159; long double ValuePi6=3141592; long double ValuePi7=31415926; long double ValuePi8=314159265; long double ValuePi9=3141592653; long double ValuePi10=31415926535; system("cls"); // clear screen cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote