Write an algorithm pseudocode and program to compute

Swamped with your writing assignments? We'll take the academic weight off your shoulders. We complete all our papers from scratch. You can get a plagiarism report upon request just to confirm.

Order a Similar Paper Order a Different Paper

Assignment: Write an algorithm (pseudocode) and program to compute π. The approximation of the important mathematical constant π will be done using the formula/algorithm described in the text – refer to P1.3 on page 29.

Output: Output will include your computed value for π, the math library constant “expected value” for π, the required delta, the desired decimal-place accuracy, and the number of iterations (loop executions) it took to reach the required decimal-place accuracy. Make your output clean, labeled, and easy to read for comparing results. No rounding is allowed. Sample output can be found below.

Input: Program will prompt a user to provide the desired decimal-place accuracy, in the range of [2-9]. User prompt must clearly indicate what is a a valid input. User input will be range-validated – ensuring that the integer value entered is between 2-9, inclusive.

Requirements: Use only material covered in the first six chapters. Style requirements as discussed in class expected. No graphics. No Big Decimals.

Efficiency should always be considered. Always choose the most appropriate loop/decision structures and variable types. No rounding is allowed. Use of appropriate constants expected – e.g. for expected value, required delta.

Your main method should reflect your high-level design – no low-level tasks in the main. Use additional static methods to support the main method, as required in order to complete the tasks identified in your design.

You may NOT use the math library constant for π in your computation – directly or indirectly. Use ONLY the delta (difference) of your running computation to determine when to stop your loop. [Hint: consider when the delta between subsequent computations ceases to meaningfully affect your computation.]


We offer CUSTOM-WRITTEN, CONFIDENTIAL, ORIGINAL, and PRIVATE writing services. Kindly click on the ORDER NOW button to receive an A++ paper from our masters- and PhD writers.

Get a 10% discount on your order using the following coupon code SAVE10

Order a Similar Paper Order a Different Paper