{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


METHODS WITH MULTIPLE PARAMETERS - If you had to calculate...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
When you are using java based applications parameters are very important. Parameters are considered variables that can be listed as part of a method declaration. Each parameter created has a unique name and defined data type. Methods with multiple parameters are declared when after the method name you have to open a parenthesis. After opening a parenthesis, you declare the type of parameter and its variable name. Some parameters are separated by commas which then the parenthesis is closed. There are many examples that you can use to show how methods are used in Java-based applications that might use methods that have two or more parameters but I will provide two examples. One example is calculating geometry which you can use more than one method.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: If you had to calculate the hypotenuse of a triangle you would need two parameters which are two sides of the triangle; side A and Side B. Or you could do another way to calculate a triangle would be by all sides, two sides and an angle, or all three angles. With these examples you are using more than on parameter. The second example can be the payroll program we just created. In that program we have to find the weekly gross pay for an employee. You would have to set variables of H= hours worked, E= employee and WG= weekly gross. Once you develop the specific information for each variable you complete the valid calculation which shows that with this method you are using more than one parameter....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online