// This program is supposed to figure out how much does a custom banner cost by figuring out the price for each letter and outputting it's total to the screen.
#include <iostream>
#include <string>
using namespace std;
int main()
{
double cost, total;
string banner;
cout << "Enter Your Banner Name (Do not use spaces)" << endl;
cout << endl;
getline(cin,banner); //User inputs their custom banner name
cout << endl;
// Outputs how many letters are in the banner
for (int i = 0; i < banner.length(); ++i)
cout << "This sentence has " << i << " letters in it." << endl;
cout << endl;
cout << "How much does each letter Cost? $";
cin >> cost;
cout << endl;
// Calculates the total cost of your made banner
total = cost * (double)banner.size();
cout << "Your total cost is: $ " << total << endl;
cout << endl;
system("PAUSE");
return 0;
}
When I run my program and type in I am Iron man it messes up. It says that I have 13 letters. It counts my spaces as letters. How can i fix this??