+ 2

Plzzzz give d identity according to dis question or just write d syntax so i can understand properly!!!

A ball is dropped from a certain height(h) and each time it bounce 0.8% less than the previous height.the ball is at rest when the height is 0.2cm.write a java program using call by value method drop() to print the no of bounce occured and previous height??? Arun Tomar Fata1 Err0r Gaurav Agrawal plzzz anyone answer it????

9th Jun 2018, 4:44 PM
Harsh Agrawal
Harsh Agrawal - avatar
4 Réponses
+ 7
The initial height of the ball, when dropped, is "h". The boolean states for the ball you have would be: "atRest" "!atRest" For each bounce, the h is 0.8% less than the previous h, i.e. h -= (h * 0.008); When h <= 0.2, atRest = true; Let's name the number of bounce variable as "counter". Pseudocode: input to h atRest is false counter is 0 while not atRest h is h - (h * 0.008) counter is counter + 1 if h is less than or equals to 0.2 atRest is true print counter Go figure.
9th Jun 2018, 4:59 PM
Hatsy Rei
Hatsy Rei - avatar
+ 6
Please post your attempts.
9th Jun 2018, 5:04 PM
Hatsy Rei
Hatsy Rei - avatar
+ 1
Hatsy Rei can u make a program so it wll be easier for me to understand quickly or just give d syntax of d program plzzzzz i tried many time but it wll not work
9th Jun 2018, 5:04 PM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Hatsy Rei but d problem is dat i have to make dis program by using call by value!!!!!! as i was just joking i was not make dis program as i just want to impress u so u can make program for me😅😅 plzzzz dont get me wrong n plzzz make dis if u want to......
9th Jun 2018, 5:12 PM
Harsh Agrawal
Harsh Agrawal - avatar