Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The program that translates a high-level source program into machine code or obj

ID: 3538207 • Letter: T

Question


The program that translates a high-level source program into machine code or object code is called a(n)

A) Linker
B) Arithmetic Logic Unit (ALU)
C) CPU
D) Compiler

2.

A procedure consisting of a number of precisely defined steps for solving a problem is called a(n):

A) program
B) algorithm
C) pseudo-code
D) compiler

3.

Which of the following used to describe the steps to be carried out by the computer in a semi-formal verbal/mathematical form?

A) program
B) algorithm
C) pseudo-code
D) compiler

4.

Which of the following is NOT one of the three basic control structures in C?

A) flow
B) sequence
C) selection
D) repetition

5.

What is the equivalent C expression for the area of a circle (PI times radius squared)?

A) 3.14 x r x r
B) 3.14r^2
C) 3.14 * r * r
D) 3.14 * r^2

6.

Every C program must have a function called main?

A) True
B) False

7.

Some statements in C do not terminate with a semi-colon?

A) True
B) False

8.

What will be the value of x below?

int a=2, b=3, c=4;

x=a + b * b + c * a;

A) 38
B) 23
C) 19
D) 66

9.

Which statement will read a floating point value from the keyboard and store it in the variable x?

A) printf(%u201Cfloat = %f%u201D, x);
B) scanf(%u201C&f%u201D, %x);
C) scanf(%u201C%d%u201D, &x);
D) scanf(%u201C%f%u201D, &x);

10.

Which statement will print the following variables correctly?int x; float y;

A) printf(%u201Cx = %d y = %f%u201D, x , y);
B) printf(%u201Cx = %f y = %f%u201D, x , y);
C) printf(%u201Cx = %d y = %lf%u201D, x , y);
D) printf(%u201Cx = %d y = %d%u201D, x, y);

11.

What will be the result of the following printf statement?

float x = 1.0, y = 3.0;

printf(%u201C%.4f%u201D, x / y);

A) 1.0/3.0
B) .3
C) .3334
D) .3333

12.

What will be the output of the following printf statement if the user enters 1234567890 at the keyboard when the scanf statement is executed?

int x, y, z;

scanf(%u201C%2d%3d%5d%u201D, &x, &y, &z);

printf(%u201C%d %d %d%u201D, x, y, z);

A) 1234567890
B) 12 34 567890
C) 12 345 67890
D) nothing, this is incorrect syntax

13.

What will be the value of the floating point variable var1 after the following scanf statement if the user enters 123.45456.78 at the keyboard?

scanf(%u201C%5f%7f%u201D, &var1, &var2);

A) 12345
B) 123.4
C) 123.45
D) 45456

14.

Relational expressions evaluate to 0 or 1?

A) True
B) False

15.

In a while loop, the initialization, condition, and increment are all in the header?

A) True
B) False

16.

Which kind of loop is best if the body of the loop must execute at least one time?

A) for
B) while
C) nested-iterative
D) do-while

17.

What will be the value of y after the following loop is run?

int x;

int y=10;

for(x=0; x<10;x++) {

--y;

}

A) 0
B) 1
C) 10
D) -1

18.

What will be the value of k after the following loop is run?

int i, j, k=0;

for (i=0; i<10;i++)

for(j=0;j<10;j++)

k++;

A) 10
B) 100
C) 1000
D) 99

19.

A for loop can count by 10?

A) True
B) False

20.

Structures can at most be nest 3 deep?

A) True
B) False

Explanation / Answer

1.D 2.B3.C4.D5.C6.A7.B8.C9.D10.A11.D12.D13.A14.A15.B16.D17.NO ANSWER 18.D19.A20.A