For example if the distance of travel is 30 kilometers the


Nearest whole kilometre

DQ1: Write a program that uses JOptionPanes to perform the following steps:

Given a distance in metres, outputs that distance in kilometres rounded to the nearest whole kilometre.

For example, given 1100m the output will be 1km, and given 1900m the output will be 2km.

Average Speed

DQ2: Write a program that uses JOptionPanes to perform the following steps:

Given the distance and time traveled, outputs the average speed.

speed = distance/time

For example, if the distance of travel is 30 kilometers, the time of travel is 2 hours, then the speed is 30/2 = 15 (kilometers per hour).

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: For example if the distance of travel is 30 kilometers the
Reference No:- TGS0665511

Now Priced at $40 (50% Discount)

Recommended (99%)

Rated (4.3/5)