<< Chapter < Page | Chapter >> Page > |
Screen output
The text shown in Figure 15 should appear in your browser window when the html file is opened in your browser.
Figure 15 . Screen output for Listing #7. |
---|
Start Script
Arrow reaches maximum height of 161.28 feetEnd Script |
Analysis of the code
Once again, compared to working through the previous exercises, this one also seems almost trivial.
After establishing values for the acceleration of gravity, the initial velocity of the arrow, and the height at which the arrow was released, the code in Listing 7 rearranges the second equation given above and solves for the value of the height (relative to the release point) at which the velocity goes to zero. This is the pointin the trajectory where the arrow turns from moving up and begins falling back toward the earth.
Note that in order to get the actual height, it was necessary to add the initial height of 6 feet to the computed height.
Compare the results
The results are shown in Figure 15 . You should compare this result with Figure 4 , which shows that the arrow reaches its maximum height at approximately 161.1 feet, which agrees very well with the result shown in Figure 15 .
I encourage you to run the scripts that I have presented in this lesson to confirm that you get the same results. Copy the code for each script into atext file with an extension of html. Then open that file in your browser. Experiment with the code, making changes, and observing the results of your changes. Makecertain that you can explain why your changes behave as they do.
I will publish a module containing consolidated links to resources on my Connexions web page and will update and add to the list as additional modulesin this collection are published.
This section contains a variety of miscellaneous information.
Financial : Although the openstax CNX site makes it possible for you to download a PDF file for the collection that contains thismodule at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, you should beaware that some of the HTML elements in this module may not translate well into PDF.
You also need to know that Prof. Baldwin receives no financial compensation from openstax CNX even if you purchase the PDF version of the collection.
In the past, unknown individuals have copied Prof. Baldwin's modules from cnx.org, converted them to Kindle books, and placed them for sale on Amazon.com showing Prof. Baldwin as the author.Prof. Baldwin neither receives compensation for those sales nor does he know who doesreceive compensation. If you purchase such a book, please be aware that it is a copy of a collection that is freelyavailable on openstax CNX and that it was made and published without the prior knowledge of Prof. Baldwin.
Affiliation : Prof. Baldwin is a professor of Computer Information Technology at Austin Community College in Austin, TX.
-end-
Notification Switch
Would you like to follow the 'Accessible physics concepts for blind students' conversation and receive update notifications?