18.6k views
4 votes
Write the definition of a method printAttitude, which has an int parameter and returns nothing. The method prints a message to standard output depending on the value of its parameter.

User Moustachio
by
5.5k points

1 Answer

11 votes

Answer:

void printAltitude(int alt) {

printf("Current altitude is %i meters.", alt)

}

Step-by-step explanation:

First declare the function saying that it won't return anything (void), then you say thatbit uses one parameter that is a Integer number (int). This parameter is stored as "alt", that you use it to print a new line by formatting it with %i.

User Eoinmullan
by
5.2k points