C++ coding, please help!!! Question 6 (1 point) The integer -1 is considered tru
ID: 3911385 • Letter: C
Question
C++ coding, please help!!!
Question 6 (1 point)
The integer -1 is considered true.
Question 6 options:
Save
Question 7 (1 point)
Given the following code fragment, and an input value of 0, what is the output that is generated?
int x;
cout <<"Enter a value ";
cin >> x;
if(x==0)
cout << "x is zero ";
else
cout << "x is not zero ";
Question 7 options:
x is zero
x is not zero
unable to determine
x is 0
Save
Question 8 (1 point)
What is the opposite of x<20 ? _______________________
_1_Question 8 options:
Save
Question 9 (1 point)
Does the code fragment below print "true" or "false"?
int x=9;
int y=10;
int z=11;
if (x < y || z < y) {
cout << "true";
}
else {
cout << "false";
}
Question 9 options:
Save
Question 10 (1 point)
What is the opposite of <=? _______________________
_1_Question 10 options:
Save
Question 11 (1 point)
Does the code fragment below print "true" or "false"?
int x=9;
int y=10;
int z=11;
if (x < y && z < y) {
cout << "true";
}
else {
cout << "false";
}
Question 11 options:
Save
Question 12 (1 point)
The opposite of > is <=
Question 12 options:
Save
Question 13 (1 point)
The opposite of (y >5 || z > 8) is (y <= 5 && z <= 8)
Question 13 options:
Save
Question 14 (1 point)
Given the following code fragment, which of the following expressions is always true?
int x;
cin >> x;
Question 14 options:
if( x > 0)
if( x )
if( (x < 10 && x > 20) )
if( (x < 20 || x > 10) )
Save
Question 15 (1 point)
Given the following code fragment, and an input value of 5, what is the output?
int x;
cin >> x;
if( x< 3)
{
cout << "small ";
}
else
{
if( x < 4)
{
cout << "medium ";
}
else
{
if( x < 6)
{
cout << "large ";
}
else
{
cout << "giant ";
}
}
}
Question 15 options:
small
medium
large
giant
Save
Question 16 (1 point)
The integer -1 is considered true.
Question 16 options:
Save
Question 17 (1 point)
If x has the value of 3, y has the value of -2, and w is 10, is the following condition true or false?
if( x < 2 && w < y)
Question 17 options:
Save
Question 18 (1 point)
The opposite of == is <>
Question 18 options:
Save
Question 19 (1 point)
Given the following code fragment and the input value of 2.0, what output is generated?
float tax;
float total;
cout << "enter the cost of the item ";
cin >> total;
if ( total >= 3.0)
{
tax = 0.10;
cout << total + (total * tax) << endl;
}
else
{
cout << total << endl;
}
Question 19 options:
2.2
2.0
3.1
4.4
Save
Question 20 (1 point)
Given the following code fragment, what is the output?
int x=5;
if( x > 5)
cout << "x is bigger than 5. ";
cout <<"That is all. ";
cout << "Goodbye ";
Question 20 options:
x is bigger than 5. That is all
x is bigger than 5
That is all. Goodbye
Goodbye
Save
Question 21 (1 point)
Given the following code fragment, and an input value of 6, what is the output?
int x;
cin >> x;
if( x< 3)
{
cout << "small ";
}
else
{
if( x < 4)
{
cout << "medium ";
}
else
{
if( x < 6)
{
cout << "large ";
}
else
{
cout << "giant ";
}
}
}
Question 21 options:
small
medium
large
giant
Save
Question 22 (1 point)
What is the correct way to write the condition y >= x >= z?
Question 22 options:
(y >= x >= z)
( (y >= x) && z)
((y >= x) || (x >= z))
((y >= x) && (x >= z))
Save
Question 23 (1 point)
What is the opposite of ( x > 5 || y < 8)? _______________________
Question 23 options:
(x <= 5 && y >= 8)
(x <= 5 || y >= 8)
(x < 5 || y > 8)
(y <= 5 || x >= 8)
True FalseExplanation / Answer
6)
The integer -1 is considered true. : TRUE, because its NON ZERO
7)
"x is zero";
8)x>=20
9) print "true"
10) >
11) false
12)True
13) True
14) if( (x < 20 || x > 10) )
15)large
16) true
17) false
18) true
19) 2.0
20) That is all. Goodbye
21)giant
22)((y >= x) && (x >= z))
23)(x <= 5 && y >= 8)
Thanks, PLEASE UPVOTE if helpful
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.