214k views
2 votes
Given that a function receives three parameters a, b, c, of type double, write some code, to be included as part of the function, that checks to see if the value of a is 0; if it is, the code prints the message "no solution for a=0" and returns from the method.

User Gsklee
by
5.3k points

1 Answer

3 votes

Answer:

Following are the code to this question:

if(a == 0) //defining condition

{

System.out.print("no solution for a=0"); //print value

}

Step-by-step explanation:

In question, it is declared, that a method defined with three double parameters, that are "a, b, and c", inside this method a code is defined, that checks the given value.

  • In the method, a conditional statement defined, in the if block, it checks the value of a is equal to 0.
  • If this condition is true, it will use the print method, inside the method, a message is printed, that is "no solution for a=0".
User Kasia
by
5.3k points