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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!