Seems you are having trouble with one of the most fundamental aspects of programming which is declaring variables.
There are certain data types which can hold different types of data.
int - holds a non decimal integer
double - holds any real number
float -same as double but uses now a negligible amount of less memory than a double data type
string - holds an array of characters
Some datatypes are declared differently such as.
string str = "this is an array of characters";
str can be named anything but make sure you be explicit when naming your variables. Do not pick arbitrary names for them.
to declare a number
1 2 3
|
int num1 = 5;
float num2 = 5.5;
double num3 = 5.4;
|
When declaring variable names you must name them differently because how is the program supposed to know which variable you are talking about.
So for your program....
You are creating a string variable with the name of employee_type;
string = employee_type;
then setting this to hourly and management.
You should look up youtube videos on declaring variables.
How you would create this little program is like this:
1 2 3 4 5
|
string employee_name = "jake35"
double employee_wage = 20.50;
string employee_management = "whatever"
|
or if you want to create some input go like this
1) create a set of variables for user input. Don't initialize them, have the user do so. Make sure you use the right datatypes...for names use a string. for pay use float or double.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
string employee_name;
double employee_wage;
string employee_management;
cout << "Enter employee name " << endl;
cin >> employee _name; // this is employee_name = user input (STRING)
cout << "Enter employee wage " << endl;
cin >> employee_wage; // this is employee_wage = user input (DOUBLE)
cout << "Enter employee Management " << endl;
cin >> employee_management; // this is employee_wage = user input (STRING)
|
hope this helps...let me know :)
UPDATE:
So you want to create an if statement
1 2 3
|
cout << "Options" << endl;
cout << "h for hourly" << endl;
cout << "m for management" << endl;
|
if (input is h)
{
do something
}
else if ( input is m)
{
do something
}