{"id":26984,"date":"2021-05-07T23:10:06","date_gmt":"2021-05-08T03:10:06","guid":{"rendered":"http:\/\/bangla.salearningschool.com\/recent-posts\/dropball-java-uses-a-while-loop-to-determine-how-long-it-takes-a-ball-to-fall-from-the-top-of-the-washington-monument-to-the-ground-programming-code-examples-java-j2ee-j2me-basic-java-2\/"},"modified":"2021-05-07T23:10:06","modified_gmt":"2021-05-08T03:10:06","slug":"dropball-java-uses-a-while-loop-to-determine-how-long-it-takes-a-ball-to-fall-from-the-top-of-the-washington-monument-to-the-ground-programming-code-examples-java-j2ee-j2me-basic-java-2","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=26984","title":{"rendered":"DropBall.java Uses a while loop to determine how long it takes a ball to fall from the top of the Washington Monument to the ground #Programming Code Examples #Java\/J2EE\/J2ME #Basic Java"},"content":{"rendered":"<pre>\nDropBall.java Uses a while loop to determine how long it takes a ball to fall from the top of the Washington Monument to the ground\n************************************************************\n\/** Simulating dropping a ball from the top of the Washington\n *  Monument. The program outputs the height of the ball each\n *  second until the ball hits the ground.\n *\n *****************************************\n\npublic class DropBall {\n  public static void main(String[] args) {\n    int time = 0;\n    double start = 550.0, drop = 0.0;\n    double height = start;\n    while (height &gt; 0) {\n      System.out.println(&quot;After &quot; + time + \n                   (time==1 ? &quot; second, &quot; : &quot; seconds,&quot;) + \n                   &quot;the ball is at &quot; + height + &quot; feet.&quot;);\n      time++;                   \n      drop = freeFall(time);\n      height = start - drop;\n    }\n    System.out.println(&quot;Before &quot; + time + &quot; seconds could &quot; +\n                       &quot;expire, the ball hit the ground!&quot;);\n  }\n  \n  \/** Calculate the distance in feet for an object in \n   *  free fall. \n   *\/\n\n  public static double freeFall (float time) {\n    \/\/ Gravitational constant is 32 feet per second squared\n    return(16.0 * time * time); \/\/ 1\/2 gt^2\n  }\n}\n@@@@@@@@@@@@@@@@@@@@\n<\/pre>\n<p>Note: Brought from our old site: http:\/\/www.salearningschool.com\/example_codes\/ on Jan 2nd, 2017 From: http:\/\/sitestree.com\/?p=10386<br \/> Categories:Programming Code Examples, Java\/J2EE\/J2ME, Basic Java<br \/>Tags:Java\/J2EE\/J2MEBasic Java<br \/> Post Data:2017-01-02 16:04:39<\/p>\n<p>\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com\/' target='new' rel=\"noopener\">https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\t(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http:\/\/Training.SitesTree.com' target='new' rel=\"noopener\"> http:\/\/Training.SitesTree.com<\/a><br \/>\n\t\tIn Bengali: <a href='http:\/\/Bangla.SaLearningSchool.com' target='new' rel=\"noopener\">http:\/\/Bangla.SaLearningSchool.com<\/a><br \/>\n\t\t<a href='http:\/\/SitesTree.com' target='new' rel=\"noopener\">http:\/\/SitesTree.com<\/a><br \/>\n\t\t8112223 Canada Inc.\/JustEtc: <a href='http:\/\/JustEtc.net' target='new' rel=\"noopener\">http:\/\/JustEtc.net (Software\/Web\/Mobile\/Big-Data\/Machine Learning) <\/a><br \/>\n\t\tShop Online: <a href='https:\/\/www.ShopForSoul.com'> https:\/\/www.ShopForSoul.com\/<\/a><br \/>\n\t\tMedium: <a href='https:\/\/medium.com\/@SayedAhmedCanada' target='new' rel=\"noopener\"> https:\/\/medium.com\/@SayedAhmedCanada <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DropBall.java Uses a while loop to determine how long it takes a ball to fall from the top of the Washington Monument to the ground ************************************************************ \/** Simulating dropping a ball from the top of the Washington * Monument. The program outputs the height of the ball each * second until the ball hits the &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=26984\">Continue reading<\/a><\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1917],"tags":[],"class_list":["post-26984","post","type-post","status-publish","format-standard","hentry","category-fromsitestree-com","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10519,"url":"http:\/\/bangla.sitestree.com\/?p=10519","url_meta":{"origin":26984,"position":0},"title":"DropBall.java Uses a while loop to determine how long it takes a ball to fall from the top of the Washington Monument to the ground","author":"","date":"August 29, 2015","format":false,"excerpt":"DropBall.java Uses a while loop to determine how long it takes a ball to fall from the top of the Washington Monument to the ground ************************************************************ \/** Simulating dropping a ball from the top of the Washington \u00a0*\u00a0 Monument. The program outputs the height of the ball each \u00a0*\u00a0 second\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10492,"url":"http:\/\/bangla.sitestree.com\/?p=10492","url_meta":{"origin":26984,"position":1},"title":"DropBall.java Uses a while loop to determine how long it takes a ball to fall from the top of the Washington Monument to the ground.","author":"","date":"August 29, 2015","format":false,"excerpt":"\/** Simulating dropping a ball from the top of the Washington \u00a0*\u00a0 Monument. The program outputs the height of the ball each \u00a0*\u00a0 second until the ball hits the ground. \u00a0* \u00a0*\u00a0 Taken from Core Web Programming from \u00a0*\u00a0 Prentice Hall and Sun Microsystems Press, \u00a0*\u00a0 . \u00a0*\u00a0 \u00a9 2001\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":26950,"url":"http:\/\/bangla.sitestree.com\/?p=26950","url_meta":{"origin":26984,"position":2},"title":"DropBall.java Uses a while loop to determine how long it takes a ball to fall from the top of the Washington Monument to the ground. #Programming Code Examples #Java\/J2EE\/J2ME #Basic Java","author":"Author-Check- Article-or-Video","date":"May 6, 2021","format":false,"excerpt":"\/** Simulating dropping a ball from the top of the Washington * Monument. The program outputs the height of the ball each * second until the ball hits the ground. * * Taken from Core Web Programming from * Prentice Hall and Sun Microsystems Press, * . * \u00a9 2001\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10279,"url":"http:\/\/bangla.sitestree.com\/?p=10279","url_meta":{"origin":26984,"position":3},"title":"BetterCircleTest.java","author":"","date":"August 26, 2015","format":false,"excerpt":"********************** BetterCircleTest.java ********************** import java.awt.*; import java.applet.Applet; \/** Position circles down the diagonal so that their borders \u00a0*\u00a0 just touch. Illustrates that Java 1.1 lightweight \u00a0*\u00a0 components can be partially transparent. \u00a0* \u00a0 *\/ public class BetterCircleTest extends Applet { \u00a0 public void init() { \u00a0\u00a0\u00a0 setBackground(Color.lightGray); \u00a0\u00a0\u00a0 setLayout(null); \u00a0\u00a0\u00a0\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":27215,"url":"http:\/\/bangla.sitestree.com\/?p=27215","url_meta":{"origin":26984,"position":4},"title":"BetterCircleTest.java #Programming Code Examples #Java\/J2EE\/J2ME #Advanced Swing","author":"Author-Check- Article-or-Video","date":"May 14, 2021","format":false,"excerpt":"********************** BetterCircleTest.java ********************** import java.awt.*; import java.applet.Applet; \/** Position circles down the diagonal so that their borders * just touch. Illustrates that Java 1.1 lightweight * components can be partially transparent. * *\/ public class BetterCircleTest extends Applet { public void init() { setBackground(Color.lightGray); setLayout(null); BetterCircle circle; int radius =\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10323,"url":"http:\/\/bangla.sitestree.com\/?p=10323","url_meta":{"origin":26984,"position":5},"title":"Simplifies the setting of native look and feel","author":"","date":"August 26, 2015","format":false,"excerpt":"WindowUtilities.java Simplifies the setting of native look and feel. #################### import javax.swing.*; import java.awt.*;\u00a0\u00a0 \/\/ For Color and Container classes. \/** A few utilities that simplify using windows in Swing. \u00a0* ################### public class WindowUtilities { \u00a0 \/** Tell system to use native look and feel, as in previous \u00a0\u00a0\u2026","rel":"","context":"In &quot;Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8&quot;","block_context":{"text":"Code . Programming Samples . \u09aa\u09cd\u09b0\u09cb\u0997\u09cd\u09b0\u09be\u09ae \u0989\u09a6\u09be\u09b9\u09b0\u09a8","link":"http:\/\/bangla.sitestree.com\/?cat=1417"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/26984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=26984"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/26984\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=26984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=26984"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=26984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}