Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need to do what it says, and I have a couple working but I am stuck on how to

ID: 3910986 • Letter: I

Question

I need to do what it says, and I have a couple working but I am stuck on how to do a R S K and an N.

My H looks like this for reference:

int midlineH = (length/2);

for (int i=0; i<length; i++) {

printf("H");

for (int j=0; j<(width/2); j++) {

if (i==midlineH) {

printf("H");

else printf(" ");

}

}

printf("H ");

}

Write a C program project3.c that operates as follows. Your program should accept two command line arguments which denote height and width (both integers). The program writes to standard output. Your program will print your Bama/Crimson userid in large block characters, such that each block has the specified height and width. (There is one exception which may affect a few students; see below for details.) Each block will consist only of individual copies of the given character and blank characters. Use uppercase letters rather than lowercase letters Here is an example output for height 9 and width 7. A larger example with height 25 and width 15 is also provided to examine. Of course, your output will be different because your userid is different.

Explanation / Answer

Not sure about this but I am certain the logic will help you for R,S and K.

For R :-

int mid = (length/2)+1;

int i,j;

for(i = 1;i<=length; i++)

{

printf("R");

for (j=1; j<= width; j++) {

if (i==mid || i==1)

printf("R");

else if ((i>1 && i<mid) && j==width)

printf("R");

else if (i>mid && j== (width-(length - i)))

printf("R");

else

printf(" ");

}

printf(" ");

}

For S :-

int mid = (length/2)+1;

int i,j;

for(i = 1;i<=length; i++)

{

for (j=1; j<= width; j++) {

if (i==mid || i==1 || i==length)

printf("S");

else if ((i>1 && i<mid) && j==1)

printf("S");

else if (i>mid && j==width)

printf("S");

else

printf(" ");

}

printf(" ");

}

For K :-

int mid = (length/2)+1;

int i,j;

for(i = 1;i<=length; i++)

{

printf("K");

for (j=1; j<= width; j++) {

if ((i>=1 && i<=mid) && j== (width-(i - 1)))

printf("K");

else if (i>mid && j== (width-(length - i)))

printf("K");

else

printf(" ");

}

printf(" ");

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote