The purpose of this lab is to use write and test a procedure that uses floating point instructions to compute an approximation to .

The purpose of this lab is to use write and test a procedure that uses floating point instructions to compute an approximation to π.

Pi can be computed using the infinite series π = 4 * (1 – 1/3 + 1/5 – 1/7 + 1/9 – 1/11 + …) or approximated by adding a finite number of the terms in the parentheses.

Let nbrTerms be the number of terms for a partial sum: 1 for 1, 2 for 1 – 1/3, 3 for 1 – 1/3 + 1/5, etc.

Write an assembly language procedure piApprox that returns a specified approximation.

A C prototype could look like float piApprox(int nbrTerms); /* returns 4 * (1 – 1/3 + 1/5 – 1/7 + 1/9 – 1/11 + …) */ /* where nbrTerms are added/subtracted in the parentheses*/

You will also write a test driver to input the number of terms, call piApprox and output the result. Here are additional specifications:

• Develop your program using Visual Studio 2015 (not an earlier or later version) • Use separate files for your test driver and procedure piApprox

• This will be a complete program that prompts for the number of terms and displays the approximation with an appropriate label. You may do this in either of two ways:

1. Write an assembly language test driver in a win32 project that uses procedure ftoaproc (section 9.3) to convert the result to ASCII for output. Note this will involve a third file and use of an appropriate EXTERN directive.

2. Write a C or C++ test driver to input the number of terms and display the result. See the instructions for creating a mixed-language VS 2015 project and the examples in the last section of the book. Note that if you choose this option, your assembly language procedure must be named _piApprox.

• As you accumulate the sum, keep the denominator (1, 3, 5, etc.) as an integer, not a floating point number. The sum and the terms you add/subtract must be floating point, of course.

 

GET THIS PAPER OR A SIMILAR PAPER WITH SUBMIT YOUR HOMEWORKS AND GET AN AMAZING DISCOUNT


The purpose of this lab is to use write and test a procedure that uses floating point instructions to compute an approximation to . was first posted on August 15, 2020 at 9:19 pm.
©2019 "Submit Your Assignment". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at support@nursingassignment.org

 

“Is this question part of your assignment? We Can Help!”

Essay Writing Service


The purpose of this lab is to use write and test a procedure that uses floating point instructions to compute an approximation to . was first posted on August 15, 2020 at 9:23 pm.
©2019 "Nursing Assignment". Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at support@nursingassignment.org

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational