Hi, I have finished my wsq14, so it had a part I didn’t (maybe don’t) understand at all but I could achieve it by checking the link http:/
Hi, I have finished my wsq14, so it had a part I didn’t (maybe don’t) understand at all but I could achieve it by checking the link http:/
Hi, I have finished my wsq14, so it had a part I didn’t (maybe don’t) understand at all but I could achieve it by checking the link http:/
In this program you need to estimate the constant “e”, to do this you need to ask the user the number of decimals points, and that will be your precision.
If you want to know about the formula that we are going to use and things about that, you can check this page: http:/
To organize the program I created a function called factorial, to calculate the factorial that will be introduced in the function calculateE.
The function calculateE is float, because is going to return a non integer number.
The loop do-while, inside the function calculateE, is useful to add the value according with the formula, but this loop will depend by the precision that the user wants.
Finally, you need to truncate the number calculated depending by the precision asked.
Here you can see my code and the program working.
If you don’t know how to round a float, you can check this page: http:/
Also, here you can find my code:
GitHub: https:/
Google Drive: https:/
Comments Off on #WSQ14
Posted in Blogs, Syndicated, TC1017 Blogs
Hey everybody! In this time, we wrote a code to calculate Euler’s constant or e number. That part was simple, the problem came when we need to stop the programm when we have the precision (decimal point numbers) that we required. To acomplishied that, we use a function called floor which we take from here
http:/
Anyway, here is the link to my code. Enjoy it!
Comments Off on WSQ14 – Calculate e
Posted in Blogs, Syndicated, TC1017 Blogs