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

Some basic comp sci questions When using the debugger, if the next statement to

ID: 647482 • Letter: S

Question

Some basic comp sci questions

When using the debugger, if the next statement to execute is a function call and the Step Into command is used, control is transferred to the called function.

A) True
B) False

How many values can a return statement return to a caller?

A) zero
B) one
C) any number
D) Both a and b.

34.

Which of the following statements correctly returns 'int' variable 'value' from a function?

A) return value();
B) return int value;
C) value return;
D) return value;

35.

The first part of a function definition (including the return type, function name, and the parameter list) is known as the function _______.

A) body
B) title
C) caller
D) header

Which of the following is not a valid increment (or decrement) of the control variable in a for repetition statement header?

A) i*=10
B) i++
C) i+1
D) i-=1

15.

In a for loop, the control variable is incremented (or decremented) _______?

A) after the body of the loop executes
B) before the body of the loop executes
C) while the loop-continuation condition is false
D) while the body of the loop executes

16.

The for header ________ can be used to vary the control variable over the odd numbers between 1 and 10.

A) for (int i=1; i<=10; i+=1)
B) for (int i=1; i<=10; i+=2)
C) for (int i=1; i<=10; i-=1)
D) for (int i=1; i<=10; i-=2)

What is the value of 'sum' after execution of the following code? (All variables are of type 'int'.)

A) 28
B) 18
C) 10
D) 30
E) none of the above

22.

A constant expression in a case label can be a character literal, an integer literal or a floating-point literal.

A) True
B) False

When an int is divided by a double, the result is ___________.

A) a double value
B) an int value
C) a syntax error
D) a fatal logic error

The body of the for loop with the header: for (int i=1; i<=10; i-=1) will be executed __________ times.

A) a very large number of
B) 9
C) 10
D) 11

Thank You!!!

Explanation / Answer

-> A) True

-> B) one

34. D) return value;

35. D) header

-> C) i+1

15. A) after the body of the loop executes

16. B) for (int i=1; i<=10; i+=2)

-> A) 28

22. B) False

-> A) a double value

-> A) a very large number of

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote