wayground logo

Тегін басып шығаруға болатын жұмыс парақтары

Қаріп өлшемі

S
M
L
XL
Жұмыс парақтары

COMPUTER SCIENCE A MIDTERM

Total сұрақ: 77

Worksheet time: 39mins

Аты
Сынып
Күн
1.

If x represents the area of the number line colored green, which inequality accurately reflects the value of x?

a)

x < 3x\ <\ 3

b)

x > 3x\ >\ 3

c)

x 3x\ \le\ 3

d)

x 3x\ \ge\ 3

2.

What is the resulting value of x?


double x;

x = 2.3

a)

2

b)

2.3

c)

Error

3.

What is the resulting value of x?


int x;

x = 2.3;

a)

Error

b)

2

c)

2.3

4.

What is the resulting value of x?


double x;

x = 7;

a)

Error

b)

7

c)

7.0

5.

What is the resulting value of x?


int x;

x = 3/4;

a)

Error

b)

0

c)

0.75

d)

1

6.

What is the resulting value of x?


double x;

x = 3/4;

a)

Error

b)

0.0

c)

0.75

d)

1.0

7.

What is the resulting value of x?


double x;

x = 3.0 / 4;

a)

Error

b)

0.0

c)

0.75

d)

1.0

8.

What is the resulting value of x?


int x;

x = 3.0 / 4;

a)

Error

b)

0

c)

1

d)

0.75

9.

What is the resulting value of x?


double x;

x = (int) (2 + 3.3);

a)

Error

b)

5

c)

5.3

d)

5.0

10.

What is the resulting value of x?


int x;

x = (double)(2 + 3.3);

a)

Error

b)

5.0

c)

5.3

d)

5

11.

What is the resulting value of x?

double x;

x = (double) (10 / 4)

a)

Error

b)

2.5

c)

2

d)

2.0

12.

What is the resulting value of x?

double x;

x = (double) 10 / 4

a)

Error

b)

2.5

c)

2

d)

2.0

13.

What is the resulting value of x?

int x;

x = (double) (10 / 4)

a)

Error

b)

2.5

c)

2

d)

2.0

14.

What data type for a constant called: PI = 3.14

a)

STRING

b)

INTEGER

c)

FLOAT

d)

BOOLEAN

15.

What data type to store the price of a CD?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

DATE

16.

What data type for a car plate number: plateNumber = "AV01-AFP"?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

DATE

17.

What data type would you use to store a discount rate (e.g. 10%)?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

DATE

18.

What data type would you use to store the number of days till Christmas?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

DATE

19.

What data type would you use to store a discount rate (e.g. 10%)?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

DATE

20.

What data type for a variable called numberOfLives in a game?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

BOOLEAN

21.

What data type would you use to store the number of days till Christmas?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

DATE

22.

What data type for a variable called numberOfLives in a game?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

BOOLEAN

23.

What data type for: age = 15?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

BOOLEAN

24.

What data type for: age = 15?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

BOOLEAN

25.

What does IDE mean?

a)

Integration Development Environment

b)

Integration Device Environment

26.

ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter “G” is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table above.


ASCII characters can also be represented by binary numbers. According to ASCII character encoding, which of the following letters is represented by the binary (base 2) number 1010100?

a)

N

b)

P

c)

T

d)

W

27.

Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?

a)

22

b)

37

c)

41

d)

82

28.

ASCII is a character-encoding scheme that uses 7 bits (8 bits if you are using the extended ASCII table) to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table above.


Which ASCII character is represented by the binary (base 2) number 1000001?

a)

A

b)

B

c)

C

d)

D

29.

Which of the following decimal values, when converted to binary (ignore leading zeros) have exactly 3 zeros in them?

Select two answers.

a)

20

b)

30

c)

40

d)

50

30.

Which of the following decimal values, when converted to binary (ignore leading zeros) have exactly 3 zeros in them?

Select two answers.

a)

20

b)

30

c)

40

d)

50

31.

Binary

a)

A way of representing information using only two options

b)

2

c)

Coding with numbers

d)

How we represent words

32.

ASCII (American Standard Code for Information Interchange)

a)

The universally recognized raw text format that any computer can understand

b)

The only way people communicate on computers

c)

Binary Code

d)

The only way computers communicate messages all the time.

33.

Packets

a)

Small chunks of information that have been carefully formed from larger chunks of information

b)

The material Mr. Ramirez Passes out

c)

The pieces of the internet that get set around

d)

The mail that is being set over the internet.

34.

Transmission Control Protocol

a)

Provides reliable, ordered, and error-checked delivery of a stream of packets on the internet

b)

Tells me how to transmit my messages to other people

c)

What we communicate

d)

Rules for receiving messages

35.

URL

a)

An easy-to-remember address for calling a web page

b)

Universal Reality Language

c)

The way websites talk to each other

d)

The IP address of a website.

36.

HyperText Transfer Protocol

a)

The protocol used for transmitting web pages over the Internet

b)

The protocol that says how fast to send text

c)

The protocol used to by text Hyper

d)

The protocol used to Transfer HyperText

37.

Which of the following are primitive data types in Java?

a)

int

b)

double

c)

char

d)

boolean

e)

word

38.

Which of the following are primitive data types in Java?

a)

byte

b)

long

c)

short

d)

float

e)

number

39.

Evaluate 813 % 100 / 3 + 2.4

a)

6.4

b)

6.73333...

c)

4.4

d)

5.06666...

40.

Evaluate 22 + 4 * 2

a)

30

b)

52

c)

28

d)

30.0

41.

Evaluate 2 * 3 + "." + 4 + 2

a)

"6.42"

b)

"23.42"

c)

"6.6"

d)

"333.6"

42.

What are the values of first and second at the end of the code?

a)

first = 19, second = 8

b)

first = 8, second = 19

c)

first = 27, second = 8

d)

first = 27, second = 19

43.

Which statement(s) are equivalent to i = i + 1?

a)

i += 1

b)

i++

c)

i -= 1

d)

i--

44.

How many times does the for loop run?

a)

2

b)

3

c)

4

d)

5

45.

How many times does the for loop run?

a)

2

b)

3

c)

4

d)

5

46.

How many times does the for loop run?

a)

2

b)

3

c)

4

d)

5

47.

How many times does the for loop run?

a)

2

b)

3

c)

4

d)

5

48.

How many times does the for loop run?

a)

2

b)

3

c)

4

d)

5

49.

How many times does the for loop run?

a)

infinitely

b)

never

50.

How many times does the for loop run?

a)

infinitely

b)

never

51.

If x = 3 and y = 5, choose all the statements that evaluate to True.

a)

x < y

b)

y > -x**2

c)

2 * x == y

d)

y % x == 3

52.

A Boolean expression...

a)

Fixes any errors in the line of code

b)

Sets everything in it equal to each other

c)

Checks if something is true or false

d)

Loops the program to continue infinitely

53.

How many values does a Boolean variable have?

a)

4

b)

3

c)

2

d)

1

e)

Infinite

54.

Which Java type can be used to store a true or false value?

a)

boolean

b)

bool

c)

Boolean

d)

Bool

55.

True/False: The body of an "if" statement will only be executed if the condition is true.

a)

True

b)

False

56.

What is missing from the command: System.___.println("Hello World");

a)

prt()

b)

Sys

c)

java

d)

out

57.

How many classes are required in a Java Program?

a)

At least one.

b)

None, you can run a basic program without a class.

c)

Two, one for the main function and one for the function code.

d)

None of the above.

58.

Which is the correct way to end a command statement in Java?

a)

;

b)

,

c)

.

d)

:

59.

Which of the reserved words is missing in this line which is found in every Java program?

public _____ void main(String[] args) {

a)

private

b)

void

c)

open

d)

static

60.

Which reserved word allows other classes to access your class in Java?

a)

private

b)

call

c)

public

d)

open

61.

Which of these is NOT a primitive datatype in Java?

a)

float

b)

int

c)

String

d)

char

62.

If you wanted to store the value 2.5 in a variable what datatype would you need to use?

a)

char

b)

float

c)

int

d)

boolean

63.

Which boolean operator should replace the @ in this code?

a)

=

b)

<=

c)

==

d)

equal

64.

What is the value of bool after running this code?

a)

true

b)

undefined

c)

false

d)

5 + 7

65.

What is the value of bool after running this code?

a)

true

b)

undefined

c)

false

d)

5 + 7

66.

What is a method?

a)

a tool that makes a program longer

b)

a tool that helps organize behaviors in a program

c)

a tool that makes a program more disorganized

d)

a tool that makes a program harder to read

e)

a tool that complicates a program

67.
How do you make an instance of the Animal class?
a)
Animal anim = new Animal();
b)
Animal = new Animal();
c)
Animal anim = new Animal;
68.

What is a class in java?

a)

A template for objects

b)

A room full of chipmunks

c)

A behavior that an object can do

d)

Another name for a variable

69.

What is an object in Java?

a)

A value with a class data type

b)

Another name for a primitive variable

c)

A template for a class

d)

When Java refuses to do what you want

70.

What is concatenation?

a)

When strings are linked together using +

b)

When numbers are added together using +

c)

The nation with cats

71.

What will be printed by the following line of code?

System.out.println("\"ice bear\"");

a)

"ice bear"

b)

ice bear

c)

""ice bear""

d)

"\"ice bear\""

72.

What method can be used to find the absolute value of a number?

a)

Math.pow()

b)

Math.abs()

c)

Math.biceps()

d)

Math.wham()

73.

What kind of data type is used for numbers?

a)

Integer

b)

String

c)

Boolean

d)

Floating Point

74.

What is a blueprint and determines how an object will behave?

a)

Object

b)

Method

c)

Attribute

d)

Class

75.

What is the resulting value of x?


double x;

x = 7;

a)

Error

b)

7

c)

7.0

76.

What does IDE mean?

a)

Integration Development Environment

b)

Integration Device Environment

77.

What data type for a car plate number: plateNumber = "AV01-AFP"?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

DATE