- #1
ineedhelpnow
- 651
- 0
Write an if-else statement to describe an object. Print "Balloon" if isBalloon is true and isRed is false. Print "Red balloon" if isBalloon and isRed are both true. Print "Not a balloon" otherwise. End with newline.
Sample program:
Below, do not type an entire program. Only type the portion indicated by the above instructions (and if a sample program is shown above, only type the <STUDENT CODE> portion.)
PLEASE HELP!
- - - Updated - - -
never mind. i got it.
Sample program:
Code:
#include <iostream>
using namespace std;
int main() {
bool isRed = false;
bool isBalloon = false;
<STUDENT CODE>
return 0;
}
PLEASE HELP!
- - - Updated - - -
never mind. i got it.
Code:
if (isBalloon==true && isRed==false) {
cout << "Balloon" << endl;
}
else if (isBalloon==true && isRed==true) {
cout << "Red balloon" << endl;
}
else {
cout << "Not a balloon" << endl;
}