I would suggest you review guides on "fundamental types" in C++.
https://msdn.microsoft.com/en-us/library/cc953fe1.aspx
A
bool can only be two values:
true or
false.
Which leads us into the second point, which is that a
variable's name has no meaning for the actual logic of the program.
The fact that your char's variable name is
e has nothing to do with the value inside that variable. It could be an 'e', or a 'g', or a '#'.
This is probably what you were actually going for:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
// Example program
#include <iostream>
#include <string>
int main()
{
using namespace std;
char med_choice;
cout << "Enter med_choice: ";
cin >> med_choice;
if (med_choice == 'e')
{
cout << "You entered e!" << endl;
}
else
{
cout << "You did not enter e." << endl;
}
}
|
See how the actual char value is
'e', with single quotation marks?
Also, when you post programs, it's extremely helpful if you actual post the whole program, or at least a simplified version of
that can still compile without making us add the #includes and main function ourselves.
Also, put your code between
[code] and
[/code] tags to have it formatted correctly.
_________________________________
Furthermore, please note that the following lines
don't do anything.
1 2 3 4 5 6
|
if (discount >= 20) {
.20*(med + den + vis);
}
else if (discount <= 10 <= 20) {
.10*(med + den + vis);
}
|
Nothing is happening here. Yes, the value 0.20*(med + den + vis) is being calculated, but the result of that calculation is not affecting the program in any way.
_________________________________
Further-furthermore:
|
else if (discount <= 10 <= 20)
|
if statements cannot work like this in C++, you have to give each condition as an individual statement:
|
else if (10 <= discount && discount <= 20)
|