Fill in the answers. For the program in question 18, include the source code in your document using a syntax highlighter.
What do the following conditions evaluate to? (true or false)
short int A = 5, B = -8, C = 18, D = 0;
- (A > B) 7. (D >= C || A == B)
- (B <= 0) 8. ((C + 1) == (D + 19))
- (D != 0) 9. (B == 0 || C == 0 || D == 0)
- (C = 17) 10. (A == 0 && (B > 1 || C > 1))
- (A > B && C > D) 11. (!(A = 5) || !(C = 8))
- (C != (B + 28)) 12. (A > (B + C) && A < (D + B))
What will the following code output?
Num Code Output - float A = 20.5, B = -20.4;
if (A > (B + 40))
cout << "Yes";
else
cout << "No"; - float Yoga = 2.5;
Yoga++; Yoga++;
if (!(Yoga < 5))
Yoga--;
else
Yoga++;
cout << Yoga; - bool Hungry = true;
bool Thirsty = false;
if (Hungry || Thirsty)
{
cout << "I'm not happy";
}
else
{
cout << "I'm very happy";
} - cout << "1";
int H = -50;
if (H < (H + 1))
cout << "2";
else
cout << "3"; - short int X = 15, Y = 18;
if (X > 9 && Y < 18)
cout << "passion";
else
cout << "papaya"; - Write a program that prompts the user to enter how many donuts they are going to eat. The program should then output how many dozen and single donuts this is. For example, if the user enters 29, the program will say, "This is 2 dozen plus 5 single donuts."
Also, have the program output different comments (minimun 6) depending on how many donuts the user enters. The ranges for the comments should be contiguous. Look at the example below, but please use your own original comments and ranges.
If the user eats this many donuts The program will output this
0 "On a diet or something?"
1 - 2 "You don't seem very hungry today"
3 - 6 "Just an appetizer for you?"
7 - 9 "What's for dessert…cinnamon rolls?"
10 - 12 "You're a donut freak!"
12 "Mmmmmmm……donuts!"
For this program only, copy the code into your Word document using a syntax highlighter so the code is presentable.