0
Need to write C++ code for mailing label 3 across and 5 down. I'm lost...
I need to write C++ code for return mailing label 3 across and 5 down. Im lost...
3 Réponses
+ 4
Format your strings for the three lines with extra spaces to fill to the next label. Repeat the following five times.
Display the name string three times before endl. Do the same for both address lines. Repeat as many endl as needed to get to next row of labels.
Best to practice on plain paper, until it appears perfect. You may need spaces before the text to get on the label or endl before the first name line.
You can make it general purpose by calling a function with the string that gets the string length and add the require spaces as it gets displayed three times.
+ 1
The thing with making such program is, how to align the columns, and distance between the labels, which also need to consider paper sizes.
Please consider to update your question tags, as it is now - you didn't have any language tagged while your question clearly stated C++ is the relevant language.
Follow this guide on posting a question, as a future reference. And good luck with that project 👍
https://www.sololearn.com/Discuss/333866/?ref=app
0
//This program prints return mailing labels
# include <iostream>
using namespace std;
int main()
{
cout << "Troy Smith \n" << "3724 Oak Dale Dr. \n" << "Pearland, TX. 77581 \n";
system ("pause");
return 0;
}