Question: 1) Write a program named TimesTen.java containing a method named timesTen The method should accept a double argument, and r eturn a double value that

1) Write a program named TimesTen.java containing a method named timesTen The method should accept a double argument, and return a double value that is 10 times the value of the argument. Put this method in a program named TimesTen to see if it works.

Inside of main method you will need to declare two variables of type double: double valuePassed = 5.2; double valueReturned; //this will hold the return value from timesTen method You will then print out valueReturned 2) Write a program named Distance.java containing a method named distance The distance a vehicle travels can be calculated as follows: distance = speed * time Write a method named distance that accepts a vehicle's speed and time as arguments, and returns the distance the vehicle has traveled.

In the main method, print out (you decide how it looks): distance speed time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!