WorksheetsBug Hunt
Total questions: 177
Worksheet time: 2hrs 56mins
I go to add a script to my character and find that my blocks have disappeared. Why is this?
Scratch Malfunctioned
I have stage selected
I have exceeded the block limit
Where do you find the background images to insert in Scratch?
Costumes
Backdrops
Gallery
Script
78-0+2-2-0+2-2+2-1
79
seventy nine
97
nine seventy
A letter or symbol to which a some value can be assigned.
Variable
Output
Bug
Statements that can only run under certain conditions or situations such as: if the seat is taken, then move to the next available seat.
conditionals (if/then statements)
variable
abstractions
binary
A piece of code with multiple steps that have been simplified down to one command which you can easily call over and over again.
digital footprint
run program
abstraction
function
Trying again and again, even when something is very hard.
command
iteration (persisting)
program
code
If I say the word "Algorithm" I am talking about what?
When we all go to a store called Rithim.
Algae that can DANCE!!!
A new dance move.
A list of steps you follow to finish a task.
What does the picture represent?
Byte
Code
Switche
Bit
Which keyword is used to come out of a loop only for that iteration?
break
continue
return
none of the mentioned above
What are the elements present in the array of the following C code?
int array[5] = {5};
5, 5, 5, 5, 5
5, 0, 0, 0, 0
5, (garbage), (garbage), (garbage), (garbage)
(garbage), (garbage), (garbage), (garbage), 5
What will be the data type returned for the following C function?
char
int
double
multiple type-casting in return is illegal
What will be the output of the following C code snippet?
returns 1
returns 2
varies
compile time error
What will be the output of the following C code? (Initial values: x= 7, y = 8)
7.000000, 7
Run time error
7.000000, junk
Varies
What will be the final value of x in the following C code?
3.75
Depends on compiler
24
3
What will happen if the following C code is executed?
It will cause a compile-time error
It will cause a run-time error
It will run without any error and prints 3
It will experience infinite looping
What is the result after execution of the following code if a is 10, b is 5, and c is 10?
a = 10, c = 10
a = 11, c = 10
a = 10, c = 11
a = 11, c = 11
How many times will the following loop execute?
for(j = 1; j <= 10; j = j-1)
Forever
Never
0
1
What does this declaration mean?
int x : 4;
X is a four-digit integer.
X cannot be greater than a four-digit integer.
X is a four-bit integer.
None of the these
What is the output of the following code ?
6
9
12
8
The______function returns a pointer to the first character of a token.
strstr()
strcpy()
strspn()
strtok()
What will be the output of the following C code?
i,am
iam
i am
error
What will be the output of the following C code?
0
1
Compile time error
Undefined behaviour
What does the following declaration mean?
int (*ptr)[10];
ptr is array of pointers to 10 integers
ptr is a pointer to array of 10 integers
ptr is an array of 10 integers
ptr is a pointer to array
OUTPUT OF THE PROGRAM
5Good Morning
M
Good
Morning
None of the above
What will be output for the following code?
Hello is printed once
Hello will be printed infinite number of times
Hello is not printed at all
0 is returned
The data structure used to implement recursive function calls _____________.
Array
Linked List
Binary tree
Stack
The following code is an example of?
double da = 4.5;
double db = 4.6;
double dc = 4.9;
int result = (int)da + (int)db + (int)dc;
printf(""result = %d"", result);
Implicit Type Conversion
Explicit Type Conversion
Error
Cannot say
Size of the array need not be specified, when
Initialization is a part of definition
It is a formal parameter
It is a declaratrion
All of the above
Array is an example of _______ type memory allocation.
Compile time
Run time
Both A and B
None of the above
What is the maximun number of dimensions an array in C may have?
Two
eight
sixteen
Theoratically no limit. The only practical limits are memory size and compilers
Let x be an array. Which of the following operations are illegal?
I. ++x
II. x+1
III. x++
IV. x*2
I and II
I,II and III
II and III
I,III and IV
III and IV
An array elements are always stored in ________ memory location.
SEQUENTIAL
RANDOM
SEQUENTIAL AND RANDOM
NONE OF THE ABOVE
What will be the output of the program ?
3,2,15
2,3,20
2,1,15
1,2,5
What is the output of C Program with switch statement or block ?
BOAT CHILLY
BOAT PETROL CHILLY
SHIP BOAT CHILLY
Compiler error
What is right way to Initialize array?
int num[6] = { 2, 4, 12, 5, 45, 5 };
int n{} = { 2, 4, 12, 5, 45, 5 };
int n{6} = { 2, 4, 12 };
int n(6) = { 2, 4, 12, 5, 45, 5 };
What is the output of C Program with switch statement or block ?
BOAT CHILLY
BOAT PETROL CHILLY
SHIP BOAT CHILLY
Compiler error
What is the output of C Program with switch statement ?
ANT KING PALACE
KING PALACE
ANT PALACE
Compiler error for using expressions
malloc() allocates memory from the heap and not from the stack.
TRUE
FALSE
May Be
Can't Say
Which function is used to delete the allocated memory space ?
Dealloc()
free()
Both a and b
None of the above
Will this program compile ?
Yes
No
In C a pointer variable to an integer can be created by the declaration
int p*;
int *p;
int +p;
int $p;
What is the output of the following program?
30
20
compile time error
run time error
How do you convert this char array to string?
char str[]={'g','l','o','b','y'};
str[5] = 0;
str[5] = '\0'
str[]={'g','l','o','b','y','\0'};
All of the above
What is the output of C Program with Strings?
globy
globy\0
compiler error
‘g’ ‘l’ ‘o’ ‘b’ ‘y’
What is the Format specifier used to print a Character array in C Printf or Scanf function?
%c
%C
%s
%d
What is the result of logical or relational expression in C?
True or False
0 or 1
0 if an expression is false and any positive number if an expression is true
none of the mentioned
Which keyword is used to prevent any changes in the variable within a C program?
immutable
mutable
const
volatile
Which of the following cannot be a variable name in C?
volatile
true
friend
export
Which of the following declaration is not supported by C?
String str;
char *str;
float str = 3e2;
both String str; & float str = 3e2;
Which of the following cannot be a variable name in C?
volatile
true
friend
export
The C-preprocessors are specified with _________ symbol.
a) #
b) $
c) ” ”
d) &
Who is the father of C language?
a) Steve Jobs
b) James Gosling
c) Dennis Ritchie
d) Rasmus Lerdorf
int main ()
{
int x = 24, y = 39, z = 45;
z = x + y;
y = z - y;
x = z - y;
printf ("n%d %d %d", x, y, z);
}
24 39 63
39 24 63
24 39 45
39 24 45
#include<stdio.h>
int main()
{
float a=0.7;
if(a<0.7)
{
printf("C");
}
else
{
printf("C++");
}
}
C
C++
Compilation Error
None of the these
#include<stdio.h>
int main()
{
char arr[11]="The African Queen";
printf("%s",arr);
}
The African Queen
The
The African
Compilation error
int main()
{
char arr[7]="Network";
printf("%s", arr);
return 0;
}
Network
N
Garbage Value
Compilation error
int main()
{
int a = 10, b = 25;
a = b++ + a++;
b = ++b + ++a;
printf("%d %d n", a, b);
}
36 64
35 62
36 63
30 28
What is the output of C Program.?
int main()
{
int a=5;
while(a=123)
{
printf("RABBIT\n");
break;
}
printf("GREEN");
return 0;
}
GREEN
RABBIT GREEN
RABBIT is printed unlimited number of times.
Compiler error.
What is the output of C Program.?
int main()
{
int a=5;
while(a==5)
{
printf("RABBIT");
break;
}
return 0;
}
RABBIT is printed unlimited number of times
RABBIT
Compiler error
None of the above.
What is the output of C Program.?
int main()
{
while(true)
{
printf("RABBIT");
break;
}
return 0;
}
RABBIT
RABBIT is printed unlimited number of times.
No output
Compiler error.
Choose a correct C for loop syntax.
for(initalization; condition; incrementoperation) { //statements }
for(declaration; condition; incrementoperation) { //statements }
for(declaration; incrementoperation; condition) { //statements }
for(initalization; condition; incrementoperation;) { //statements }
Choose correct C while loop syntax.
while(condition) { //statements }
{ //statements }while(condition)
while(condition); { //statements }
while() { if(condition) { //statements } }
Which loop is faster in C Language, for, while or Do While.?
for
while
do while
all of the above
What is the output of C Program.?
int main()
{
int k;
for(printf("FLOWER "); printf("YELLOW "); printf("FRUITS "))
{
break;
} return 0;
}
Compiler error
FLOWER FRUITS
FLOWER YELLOW
FLOWER YELLOW FRUITS
What is the output of C Program.?
int main()
{
int k;
for(;;)
{
printf("TESTING\n");
break;
}
return 0;
}
No Output
TESTING
Compiler error
None of the above
What is the output of C Program.?
int main()
{
int k;
for(k=1; k <= 5; k++);
{
printf("%d ", k);
}
return 0;
}
1 2 3 4 5
1 2 3 4
6
5
What is the output of C Program.?
int main()
{
int k, j;
for(k=1, j=10; k <= 5; k++)
{
printf("%d ", (k+j));
}
return 0;
}
compiler error
10 10 10 10 10
10 11 12 13 14 15
None of the above
Choose correct Syntax for C Arithmetic Compound Assignment Operators.
a+=b is (a= a+ b)
a-=b is (a= a-b)
a*=b is (a=a*b)
a/=b is (a = a/b)
a%=b is (a=a%b)
All the above.
Choose a correct C Statement.
a++ is (a=a+1) POST INCREMENT Operator
a-- is (a=a-1) POST DECREMENT Operator
--a is (a=a-1) PRE DECREMENT Operator
++a is (a=a+1) PRE INCREMENT Operator
All the above.
What is the output of C Program.?
int main()
{
int a=32;
do
{
printf("%d ", a);
a++;
if(a > 35)
break;
}
while(1);
return 0;
}
No Output
32 33 34
32 33 34 35
Compiler error
What is the output of C Program.?
int main()
{
int a=32;
do
{
printf("%d ", a);
a++;
}
while(a <= 30);
return 0;
}
32
33
30
No Output
What is the output of C Program.?
int main()
{
int a=25;
while(a <= 27)
{
printf("%d ", a);
a++;
}
return 0;
}
25 25 25
25 26 27
27 27 27
Compiler error
What is the output of C Program.?
int main()
{
int a=5;
while(a >= 3);
{
printf("RABBIT\n");
break;
}
printf("GREEN");
return 0;
}
GREEN
RABBIT GREEN
RABBIT is printed infinite times
None of the above
Finding and fixing errors in a program.
debugging
decompose
digital footprint
variables
A user does this to tell the computer start the commands you have written into the program.
event
run program
function
abstraction
A field of science in which people use the power of computers to solve big problems.
command
computer science
code
program
When you tell the computer to repeat a command or step over and over and over and over and over and over and over and over and over and... oh yeah, over again as many times as you tell to repeat.
Deja Vu
Loop
Repeating
Being annoying
A computer program is
a show on TV.
an algorithm that has been coded into something that can be run by a machine.
a professional graham cracker.
part of a S'more.
Code is...
when it's not warm.
the dog from Garfield.
a song or poem dedicated to someone.
specific instructions in a computer program.
Problems or mistakes in the code for an algorithm or program are known as:
Bugs
Slugs
Tugs
Rugs
In coding an event is what?
An action that causes something to happen.
An item on your calendar.
A way to move air.
A device that blows air into your computer.
What is the Internet?
A local network.
Mobile phone network.
Is the global system of interconnected computer networks that use the TCP/IP protocol to link devices worldwide.
A local computer network providing a variety of information and communication facilities.
WWW stands for
World Worm Web
World Wide Web
World Word Web
World Wild Web
Which of these is Google Drive?
Reg No in full
C programs are converted into machine language with the help of
An Editor
A compiler
An operating system
None of these.
The continue statment cannot be used with
for
while
do while
switch
In the following loop construct, which one is executed only once always.
for(exp1; exp2; exp3)
exp1
exp3
exp1 and exp3
exp1,exp2 and exp3
Choose a correct C do while syntax.
dowhile(condition) { //statements }
do while(condition) { //statements }
do { //statements }while(condition)
do { //statements }while(condition);
What is the way to suddenly come out of or Quit any Loop in C Language.?
continue; statement
break; statement
leave; statement
quit; statement
Loops in C Language are implemented using.?
While Block
For Block
Do While Block
All the above
Choose a right C Statement.
Loops or Repetition block executes a group of statements repeatedly.
Loop is usually executed as long as a condition is met.
Loops usually take advantage of Loop Counter
All the above.
Inside try
Exception Caught
After throw
After catch
Inside try
Exception Caught
After catch
Inside try
Exception Caught
Inside try
After throw
After catch
Compile Error
Inside Fun1()
Inside Fun2()
Inside Fun1() Inside Fun2()
Inside Fun2() Inside Fun1()
0
1
2
3
There are two count variables. Not enough info
0
5
-5
10
-10
1
2
4
8
What is the difference when allocating the following memory?
int array1[15];
int array2[3][5];
array1 is larger
array2 is larger
The size allocated is the same
1
6
12
24
The derived class can not call the base class func().
Must place “using namespace Base” at the top of the file.
Base::d.func();
d.Base::func();
When overloading a function, the signature of the function is determined by:
The name of the function
The name of the function and number of argument and types
The return type, name and number of arguments and types.
What happens if the word static is placed in front of a member function in C++?
The member function can be called even if we do not create an instance of the class.
It places the member function in the static part of memory
It will cause an error and the program will not compile.
None of the above.
What does the word virtual do when placed in front of a member function in C++?
Forces derived classes to define the function to compile.
Allows derived classes, not required, to define the function.
Does not place the function in text segment if it is not called.
None of the above.
When class B is inherited from class A, what is the order in which the destructors are called.
Class A first Class B next
Class B first Class A next
Class B's only as it is the child class
Class A's only as it is the parent class
I only
II only
III only
I and II only
II and II only
Equal strings
There will be a compile error and it will not run
Nothing will be output on the console
None of the above
What does the word const do when placed at the end of a member function in a class?
It is required for C++
States the return type is constant
States the input arguments are constant
States the member variables will not change
None of the above
When a class is derived from a base class it gets access to:
Private
Protected
Private and Protected
Protected and Public
Private, Protected and Public
When a class becomes a friend of another class they are additionally getting access to:
Private
Protected
Public
None of the above
There can only be one catch block in a program
True
False
The compiler creates an instance of a function template in memory as soon as it encounters the template.
True
False
What happens if an exception is thrown in a function, but not caught?
The program continues executing and it is ignored.
The function that throws the exception is exited.
The program terminates.
The compiler will find the error and the program would not compile.
For a random number generator, you write it as
sin()
rand()
cos()
abs()
iostream
Displays output from the screen and input from the keyboard
Has all the math equations
Counts the time
Checks if the code has a function
Secondary Functions
Is a function executed inside the main function
Is a function executed in another program
Is a function executed outside the main function
Is the main function
Switch Statement
Is a statement with a set of conditions called cases
Is a case
Is a condition with no cases
Is a boolean statement
Do while loops
Runs a statement once
Runs a statement twice
Runs a statement multiple times or not within a boolean condition
Doesn't run at all
If-else
Optional value for the program to execute
Is a condition followed by a statement or a set of statements
Is a statement followed by a condition or a set of conditions
Function with a value
______ is used to input value from the user.
cin>>
cin<<
<cin>
Two expressions can be compared using ___________ operator.
Logical
Relational
Arithmetic
the five arithmetic operators supported by c++
+,-,*,/,%
()$%
{<>}
When using the ______________,C++ only evaluates what is necessary from left to right to come up with combined reational results,.
logical operaters
compound assignment
associative
in the _________, c++ only evaluates what is necessary from left to right to come up with the combined relational result.
arithmetic operartor
relational operator
none
Logical opeartor
the <iostream .h> provides the basic INPUT and output fundamentales
true
false
maybe
_________ are fixed values used by a program
constant
variable
boolean
float
a program written in a high language is called a ____________
object
source code
variable
constant
the wrapping up of data and functions together is called as _______________________
class
encapsulation
integer
syntax
c++ is an _____________ , developed by ______________ , and is an extension of c language
object oriented program , Bjarane
class and data
complier, interpreter
functions comments
an object is a /an instance of _______________
class
C++
object
iostream.h
If originally x=2,y=0, and z=1, what is the value of x, y, and z after executing the following code?
if (x>y)
y=x;
else
z=x;
x=2 y=2 z=1
x=0 y=2 z=0
x=2 y=1 z=1
x=2 y=0 z=1
Evaluate the following expressions to true or false
5 >= (1+6)-4
True
False
Evaluate the following expressions to true or false
5+1==6 || 8-1>4
True
False
Program
int main()
{
cout<<"Hi everybody";
return 0;
}
y = 3;
x = 5 * y;
Which of the following is a correct comment?
*/ Comments */
** Comment **
/* Comment */
{ Comment }
What punctuation is used to signal the beginning and end of code blocks?
{ }
-> and <-
BEGIN and END
( and )
What is the only function all C++ programs must contain?
start()
system()
main()
program()
What type of variable can be defined in an interface?
public static
private final
public final
static final
Which of these can be used to fully abstract a class from its implementation?
Objects
Packages
Interfaces
None of the Mentioned
super keyword is used to access
only subclass methods
parent class variables and methods
subclass variables and methods
only parent class methods
Which of the following is/are false about inheritance in Java?
I. A subclass inherits all the methods and variables of the superclass.
II. A subclass can override the methods of its superclass
III. A subclass has access to the private instance variables of the superclass.
I only
II only
III only
I and II only
I and III only
The following Syntax is used for?
class Subclass-name extends Superclass-name
{
//methods and fields
}
Polymorphism
Encapsulation
Inheritance
None of the above
_____ is used to find and fix bugs in the Java programs.
JVM
JRE
JDK
JDB
Which of the following option leads to the portability and security of Java?
Bytecode is executed by JVM
The applet makes the Java code secure and portable
Use of exception handling
Dynamic binding between objects
Which method is called to end applet
stop()
destroy()
terminate()
end()
Which of the applet method called only once
init()
start()
paint()
stop()
Which of the following is not a method of applet class
init()
start()
drawLine()
paint()
What invokes immediately after the start() method and also any time the applet needs to repaint itself in the browser?
a. stop()
b. init()
c. paint()
d. destroy()
