CSE 100, CIDSE Lab 4 Repletion in C++, Increment and decrement, While loops LAB 4 : Please Submit Your Program Under Lab 4 Assignment Submission Wat e r me l on Pr ogr am
CSE 100, CIDSE Lab 4 Repletion in C++, Increment and decrement, While loops LAB 4 : Please Submit Your Program Under Lab 4 Assignment Submission Wat e r me l on Pr ogr am : Suppose Dave dr ops a wat er mel on of f a hi gh br i dge and l et s i t f al l unt i l i t hi t s t he wat er . I f we negl ect ai r r esi st ance, t hen t he di st ance d i n met er s f al l en by t he wat er mel on af t er t seconds i s d = 0. 5 * g * t 2 , wher e t he accel er at i on of gr avi t y g = 9. 8 met er s/ second. Wr i t e a pr ogr am t hat asks t he user t o i nput t he number of seconds t hat t he wat er mel on f al l s and t he hei ght h of t he br i dge above t he wat er . The pr ogr am shoul d t hen cal cul at e t he di st ance f al l en f or each second f r om t = 0 unt i l t he val ue of t i nput by t he user . I f t he t ot al di st ance f al l en i s gr eat er t han t he hei ght of t he br i dge, t hen t he pr ogr am shoul d t el l t he user t hat t he di st ance f al l en i s not val i d. Sampl e Run 1: Pl e as e i nput t he t i me of f al l i n s e c onds : 2 Pl e as e i nput t he he i ght of t he br i dge i n me t e r s : 100 Ti me Fal l i ng ( s e c onds ) Di s t anc e Fal l e n ( me t e r s ) ******************************************* 0 0 1 4. 9 2 19. 6 Sampl e Run 2: Pl e as e i nput t he t i me of f al l i n s e c onds : 4 Pl e as e i nput t he he i ght of t he br i dge i n me t e r s : 50 Ti me Fal l i ng ( s e c onds ) Di s t anc e Fal l e n ( me t e r s ) ******************************************* 0 0 1 4. 9 2 19. 6 3 44. 1 4 78. 4 War ni ng- Bad Dat a: The di s t anc e f al l e n e xc e e ds t he he i ght of t he br i dge Submi s s i on I ns t r uc t i ons Save your pr ogr am as Lab4. c pp and s ubmi t i t t o Lab4 ASSI GNMENT SUBMI SSI ON.
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"
