How do i go about getting a name from a user and using it throughout the entire program im coding. itll be used quite frequently. its a piggy bank program.so far thats what i have. any tips?
#include <string>
#include <iostream>
#include <iomanip>
usingnamespace std;
int main()
{
// DECLARING THE VARIABLES
int name, saved, total, quarters, dimes, nickles, pennies, weeks;
std::cout.precision(6);
// Title Screen
cout << "Welcome to the Piggy Bank Program!" << endl;
cout << "Press Enter to Continue";
cin.ignore();
cout << "Hi, can I please have your name so I can address you properly?";
cin >> name;
cout << "Wow!" <<name;
cout << "I like that name!";
system("pause");
return 0;
}