274,486 views
14 votes
14 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 Ed B
by
2.8k points

1 Answer

22 votes
22 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 Jason Leach
by
2.9k points