Question: Write a method named draw_patch(int width, int height, char primary, char secondary) which will print the primary character on even columns and the secondary character
Write a method named draw_patch(int width, int height, char primary, char secondary) which will print the primary character on even columns and the secondary character on odd columns.
For example:
| Test | Result |
|---|---|
drawPatch(5, 7, '+', '-'); | + - + - + + - + - + + - + - + + - + - + + - + - + + - + - + + - + - + |
start with
public void drawPatch(int width, int height, char primary, char secondary) { // TODO your code goes here }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
