Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that will generate the nber PI to the user with defined decimal places. NO ROUNDING. PI is estimated as 3.1415926535897932. When

Write a C++ program that will generate the nber PI to the user with defined decimal places. NO ROUNDING. PI is estimated as 3.1415926535897932.

image text in transcribed

When you run/execute the program 1. The user will be prompted to enter a number between 1 and 16, anything else the program exit displaying message stating not valid input. 2. If the input is valid, the program will display the exact decimal places the user entered, for example: If the user entered 5 decimal places the output should be: 3.14159 not 14169 Also If the user entered 4 decimal places the output should be: 3.1415 not 31416 Notes 1. Make sure you use proper variable and constant declaration. 2. If the program is not outputting the correct result no credit will be given Ref: e https://www.google.com/search?g-Pl+&ie-utf-8&oe-utf-8 https://en.wikipedia.org/wiki/Pi e http://www.pidav.org/million Extra Directions: 1. Using printf(print format) and/or setprecision (n) will not work since it will round, and if you round no credit will be given don't use switch statement to iterate through the user selection (from 1 to 16), this is not acceptable see below code snip (you should not use something like this in your code): switch (position) 2. case 1: userSelectPI3.1; break; case 2: userSelectPI3.14; break; case 3: userSelectPI3.141; break; case 4: 3. Make sure your code compile and run to get credit, no partial credit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Problem: Evaluate the integral: I - -[ze dx

Answered: 1 week ago

Question

Problem: Evaluate the integral: I = 1- 1 dx 9

Answered: 1 week ago

Question

Describe the Indian constitution and political system.

Answered: 1 week ago

Question

3. How has Starbucks changed since its early days?

Answered: 1 week ago