Asked by Mike
Write a program that displays your initials in a pattern on the screen. Compose each initial with six lines of smaller initials, as the following example:
J FFFFFF
J F
J FFF
J F
J J F
JJJJJJ F
J FFFFFF
J F
J FFF
J F
J J F
JJJJJJ F
Answers
Answered by
MathMate
The trick here is to design each letter in a 6x6 matrix. Each letter will therefore be made up of an array of 6 strings, each of which will have 6 characters.
Example string array which can be name
by the letters themselves:
String[] f={
"FFFFFF",
"F",
"FFF",
"F",
"F",
"F"
};
So to display the letters, you only have to print them on six lines, like:
for(int i=0;i<6;i++){
System.out.println(j[i]+" "+f[i]);
}
(I am using Java syntax, hope you can do the conversion for C#)
Example string array which can be name
by the letters themselves:
String[] f={
"FFFFFF",
"F",
"FFF",
"F",
"F",
"F"
};
So to display the letters, you only have to print them on six lines, like:
for(int i=0;i<6;i++){
System.out.println(j[i]+" "+f[i]);
}
(I am using Java syntax, hope you can do the conversion for C#)
Answered by
R
I need an answer
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.