Created
October 24, 2022 03:46
-
-
Save Tokiyomi/fb38b0ed6827e7f239e8c6df80e9d475 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Constructing the string to print multiple times | |
String plus = ""; | |
String bars = ""; | |
// Plus sign string | |
for (int i = 0; i < cols ; i ++) { | |
plus += "+-"; | |
} | |
plus += "+"; | |
// Bar sign string | |
for (int i = 0; i < cols ; i ++) { | |
bars += "|."; | |
} | |
bars += "|"; | |
// Printing rest of the punch card | |
for (int i = 0; i < rows ; i ++) { | |
print(plus); | |
if (i == rows - 1) { | |
continue; | |
} else { | |
print(bars); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment