Hello. I am trying to get this program to read a user string and output the message in large block letters. I have it set to where it prints out the letters the user types in, but they output vertically. I am trying to get them to output horizontally like an actual word. Could somebody please help me?
(note: I only did letter a-f for now but once I get it working I will add the rest.)
Thanks
Code:
#include <iostream>
#include <string>
#include <cmath>
#include <cstdlib>
#include <stdio.h>
#include <Windows.h>
using namespace std;
struct letter {
string lines[5];
} A = {
" AAA ",
"A A",
"AAAAA",
"A A",
"A A"};
letter B = {
"BBBB ",
"B B",
"BBBB",
"B B",
"BBBB "
};
letter C = {
" CCCC",
"C ",
"C ",
"C ",
" CCCC"
};
letter D = {
"DDDD ",
"D D",
"D D",
"D D",
"DDDD "
};
letter E = {
"EEEEE",
"E ",
"EEEEE",
"E ",
"EEEEE"
};
letter F = {
"FFFFF",
"F ",
"FFFF ",
"F ",
"F "
};
int main()
{
string first;
char firstChar;
int a, b;
letter array[6] = { A, B, C, D, E, F };
cout << "Please enter a message: ";
cin >> first;
for (int j = 0; j < first.size(); j++) {
firstChar = toupper(first[j]);
firstChar -= 'A';
for (int i = 0; i < 5; i++) {
cout << array[firstChar].lines[i] << endl;
}
}
return 0;
}