0

Here is the snippet of code I am having issues with.

    cout<<"So are you a male or female,  Please type m/f"<<endl;
    cin>>sex;

    if (sex='M','m') 
    {
    alcohol_distribution=.73;
} 
    else if (sex='F','f') 
    { 
    alcohol_distribution=.66;
}

So I know I have this terribly wrong, but i want the alcohol_distribution based on whether or not the user is a male or female. thank you very much.

Edited by mike_2000_17: Fixed formatting

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by br007
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.