Computers and Technology
Computers and Technology, 06.10.2019 23:30, ericb6939

cs 124 test 1 practice

1. which of the following lines of c++ specifies that a library is to be used?

a. int main()
c. #include
b. using namespace std;
d. return 0;

2. every complete statement ends with a:

a. close curly brace }
c. semicolon ;
b. comma ,
d. period .

3. what does the line #include do in our programs?

a. prints text on the screen
c. nothing; it is just something that every program needs to have at the top of the file
b. tells the compiler to use the iostream library
d. accepts input from the user

4. how many main()s are there in the typical program?

a. exactly one.
c. none.
b. at least one.
d. more than one.

5. which takes up more space in memory?

a. uchar
c. int
b. char
d. short

6. which of the following sets the value 9,203.10 to the variable q?

a. float q = 9,203.10;
c. int q = 9,203.10;
b. int q = 9.2031e3;
d. float q = 9.2031e3;

7. which data type can hold a larger number?

a. float
c. int
b. char
d. real

8. what is a variable?

a. a pointer or address
c. all of the above
b. a named location where we store data
d. a constant value interchangable with a static number

9. select all that apply. floating point numbers are:

a. numbers with a decimal component
c. approximations, an inexact representation of a number
b. numbers with an unknown exponent
d. similar to real numbers

10. which is equivalent to the following statement? :
a = ++b * c;

a. a = 1 + (b * c);
c. b++; a = b * c;
b. a = (b + 1) * c;
d. a = b * c; b++;

11. which is equivalent to the following expression:
a = ! b == false & & c * 2

a. a = == false) & & (c * ;
b. a = ) == false) & & c) * 2);
c. a = == false)) & & (c * 2));
d. a = ) == false) & & (c * 2));

12. which is equivalent to the following expression:
a = b + c * d++ / 3;
a. a = (b + (c * ((d++) / ;
b. a = + c) * (d++)) / 3);
c. a = ((b + (c * (d++ / 3);
d. a = (b + ((c * (d++)) / 3));

13. what is the output of the following code fragment:
{
cout < < 8 + 12 * 2 - 4 < < endl;
}
a. 36
c. 28
b. 8
d. -40

14. what is the output of the following code fragment:
{
cout < < 3 - 15 / 2 < < endl;
}
a. -4
c. -4.5
b. 5
d. 2

15. what is the output of the following code fragment?
{
int x = 2;
int y = 3; ;
cout < < x + 2 / 6 + y < < endl;
}
a. 5
c. 0
b.
d. 5

16. what is the output?
{
int a = 386;
int b = (a / 10) % 10;
cout < < b < < endl;
}
a. 8
d. 86
b. 386
e. 3
c. 38
f. 6

17. what is the output of the following code fragment:
{
int i = 4 * 0.9;
int j = i * 2;
cout < < j < < endl;
}
a. 6
c. 7.2
b. 8
d. 0

18. what is the output of the following code fragment:
{
int x = 27;
cout < < x++ < < endl;
cout < < x++ < < endl;
}
a.
27
27
c.
28
28
b.
27
28
d.
28
29

19. which of the following moves the cursor to the next tab stop?
a. \t
c. /n
b. /t
d. \n

20. consider the following code:
cout < < "hello" < < endl;
which of the following does the same thing as endl in the above example?

a. '/n'
c. /n
b. \n
d. '\n'

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:00, ladyree8721
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
image
Computers and Technology, 23.06.2019 00:50, AmbitiousAndProud
Representa os dados de um banco de dados como uma coleç? o de tabelas constituídas por um conjunto de atributos, que definem as propriedades ou características relevantes da entidade que representam. marque a alternativa que representa o modelo descrito no enunciado. escolha uma:
Answers: 3
image
Computers and Technology, 23.06.2019 07:10, anika420
If you want to import a picture into a dtp application, what must you do first? draw an image frame. import text. open the folder containing the file. select get image… from the windows menu.
Answers: 2
image
Computers and Technology, 23.06.2019 22:30, delawdermia27
The output voltage of a power supply is assumed to be normally distributed. sixteen observations are taken at random on voltage are as follows: 10.35, 9.30, 10.00, 9.96, 11.65, 12.00, 11.25, 9.58, 11.54, 9.95, 10.28, 8.37, 10.44, 9.25, 9.38, and 10.85
Answers: 1
Do you know the correct answer?
cs 124 test 1 practice

1. which of the following lines of c++ specifies that a library i...

Questions in other subjects: