SOURCE FILE: formlett.cpp
//******************************************************************
// FormLetter program
// This program prints a form letter for a promotional contest.
// It uses the four parts of a name to build name strings in four
// different formats to be used in personalizing the letter
//******************************************************************
#include <iostream>
#include <string>
using namespace std;
const string TITLE = "Dr."; // Salutary title
const string FIRST_NAME = "Margaret"; // First name of addressee
const string MIDDLE_INITIAL = "H"; // Middle initial
const string LAST_NAME = "Sklaznick"; // Last name of addressee
int main()
{
string first; // Holds the first name plus a blank
string fullName; // Complete name, including title
string firstLast; // First name and last name
string titleLast; // Title followed by the last name
// Create first name with blank
first = FIRST_NAME + " ";
// Create full name
fullName = TITLE + " " + first + MIDDLE_INITIAL;
fullName = fullName + ". " + LAST_NAME;
// Create first and last name
firstLast = first + LAST_NAME;
// Create title and last name
titleLast = TITLE + " " + LAST_NAME;
// Print the form letter
cout << fullName << " is a GRAND PRIZE WINNER!!!!!!" << endl
<< endl;
cout << "Dear " << titleLast << "," << endl << endl;
cout << "Yes it's true! " << firstLast << " has won our"
<< endl;
cout << "GRAND PRIZE -- your choice of a 42-INCH* COLOR"
<< endl;
cout << "TELEVISION or a FREE WEEKEND IN NEW YORK CITY.**"
<< endl;
cout << "All that you have to do to collect your prize is"
<< endl;
cout << "attend one of our fun-filled all-day presentations"
<< endl;
cout << "on the benefits of owning a timeshare condominium"
<< endl;
cout << "trailer at the Happy Acres Mobile Campground in"
<< endl;
cout << "beautiful Panhard, Texas! Now " << first << "I realize"
<< endl;
cout << "that the three-hour drive from the nearest airport"
<< endl;
cout << "to Panhard may seem daunting at first, but isn't"
<< endl;
cout << "it worth a little extra effort to receive such a"
<< endl;
cout << "FABULOUS PRIZE? So why wait? Give us a call right"
<< endl;
cout << "now to schedule your visit and collect your" << endl;
cout << "GRAND PRIZE!" << endl << endl;
cout << "Most Sincerely," << endl << endl;
cout << "Argyle M. Sneeze" << endl << endl << endl << endl;
cout << "* Measured around the circumference of the packing"
<< endl;
cout << "crate. ** Includes air fare and hotel accommodations."
<< endl;
cout << "Departure from Nome, Alaska; surcharge applies to"
<< endl;
cout << "other departure airports. Accommodations within"
<< endl;
cout << "driving distance of New York City at the Cheap-O-Tel"
<< endl;
cout << "in Plattsburgh, NY." << endl;
return 0;
}