O'Reilly logo

Programming with Java by Sunil Patekar, Mahesh Bhave

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 26

COLLECTION OF PROGRAMS

In this chapter, we will see both applications and applets. We will try to cover problems from different walks of life.

26.1 Projectile

When we see a fielder standing on boundary line, throwing the ball straight into the gloves of the wicket keeper, we think that he is a genius. Well, he may or may not be, but one thing is sure. He has done his college physics seriously. A projectile starting at an angle of 45 degrees travels farthest, before hitting the ground.

Let us develop an applet to show the trajectory of a projectile.

Problem: Write an applet to show the trajectory of a projectile.

Solution: Let us assume the following:

When a projectile starts, it has velocities both in horizontal and vertical direction. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required