Ask Question
11 September, 05:16

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.

+5
Answers (1)
  1. 11 September, 05:39
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers