|
Java Exercises - Methods
Page history
last edited
by Steve Sweeney 14 years, 1 month ago
- Write a method printTriangle that has a char parameter c and an int parameter n. The method should print a triangular pattern with the perimeter consisting of the character c and the interior (if there is one) consisting of blanks. For example, the call printTriangle('*',5); should produce the following output:
*
**
* *
* *
*****
- Write a method called convertToGrade that returns a char value, and accepts an int parameter called mark. The method should return the letter grade that corresponds to the value of mark (A, B, C, D, or F). If the method receives an invalid value (outside of 0-100), it returns the character 'X'.
Java Exercises - Methods
|
Tip: To turn text into a link, highlight the text, then click on a page or file from the list above.
|
|
|
Comments (0)
You don't have permission to comment on this page.