Ask Question
26 September, 04:28

Write the definition of a method printGrade, which has a char parameter and returns nothing. The method prints on a line by itself the message string Grade: followed by the char parameter (printed as a character) to standard output. Don't forget to put a new line character at the end of your line.

+4
Answers (1)
  1. 26 September, 07:54
    0
    The answer to this question can be given as:

    Method Definition:

    void printGrade (char x) / /declare method with parameter.

    {

    //method body

    System. out. println ("Grade: "+x);

    //print value in new line.

    }

    Explanation:

    In the above method definition, we define a method that's name is already given in the question that is printGrade. This method does not return any value because its return type is void. In this method, we pass a char variable as a parameter. Then we define the method body in the method body we print the value of the char variable in the new line. To print the value in the new line we use the println function in java.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write the definition of a method printGrade, which has a char parameter and returns nothing. The method prints on a line by itself the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers