Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the bool variables neutral , base , and acid : false , false , true if pH is less than 7 false , true , false if pH is greater than 7 true , false , false if pH is equal to 7

LANGUAGE: C++

CHALLENGE:

Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the bool variables neutral , base , and acid : false , false , true if pH is less than 7 false , true , false if pH is greater than 7 true , false , false if pH is equal to 7

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

1 Comment

  1. Alexa on June 17, 2015 at 11:43 am

    if (pH 7)
    {
    neutral = 0;
    base = 1;
    acid = 0;
    }
    else
    {
    neutral = 1;
    base = 0;
    acid = 0;
    }

Leave a Comment

You must be logged in to post a comment.