Using any of the methods you created in the Unit 3 Discussion or a new method of
ID: 3867157 • Letter: U
Question
Using any of the methods you created in the Unit 3 Discussion or a new method of your choosing that fits the ABC Bank Corp class you selected, write a Java method that includes the following:
At least two parameters that are passed into the method, including one that is numeric
At least one numeric value that will be returned by the method
A variable that is legally declared twice (with the same name both times) within the method
Then, explain the function of each parameter and variable you included in your selected method.
Explanation / Answer
// A method to accept two parameters with one Double(Number) and returns a number of type Double
public double methodOne(double num, char c) {
// Declaring a variable
double num2 = num1;
if(c=='y') {
// Declaring another variable with the same name and type
double num2 = 0.0;
}
// Returns a number
return num2;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.