Қаріп өлшемі
Жұмыс парақтарыCOMPUTER SCIENCE A MIDTERM
Total сұрақ: 77
Worksheet time: 39mins
If x represents the area of the number line colored green, which inequality accurately reflects the value of x?
x < 3
x > 3
x ≤ 3
x ≥ 3
What is the resulting value of x?
double x;
x = 2.3
2
2.3
Error
What is the resulting value of x?
int x;
x = 2.3;
Error
2
2.3
What is the resulting value of x?
double x;
x = 7;
Error
7
7.0
What is the resulting value of x?
int x;
x = 3/4;
Error
0
0.75
1
What is the resulting value of x?
double x;
x = 3/4;
Error
0.0
0.75
1.0
What is the resulting value of x?
double x;
x = 3.0 / 4;
Error
0.0
0.75
1.0
What is the resulting value of x?
int x;
x = 3.0 / 4;
Error
0
1
0.75
What is the resulting value of x?
double x;
x = (int) (2 + 3.3);
Error
5
5.3
5.0
What is the resulting value of x?
int x;
x = (double)(2 + 3.3);
Error
5.0
5.3
5
What is the resulting value of x?
double x;
x = (double) (10 / 4)
Error
2.5
2
2.0
What is the resulting value of x?
double x;
x = (double) 10 / 4
Error
2.5
2
2.0
What is the resulting value of x?
int x;
x = (double) (10 / 4)
Error
2.5
2
2.0
What data type for a constant called: PI = 3.14
STRING
INTEGER
FLOAT
BOOLEAN
What data type to store the price of a CD?
STRING
INTEGER
FLOAT
DATE
What data type for a car plate number: plateNumber = "AV01-AFP"?
STRING
INTEGER
FLOAT
DATE
What data type would you use to store a discount rate (e.g. 10%)?
STRING
INTEGER
FLOAT
DATE
What data type would you use to store the number of days till Christmas?
STRING
INTEGER
FLOAT
DATE
What data type would you use to store a discount rate (e.g. 10%)?
STRING
INTEGER
FLOAT
DATE
What data type for a variable called numberOfLives in a game?
STRING
INTEGER
FLOAT
BOOLEAN
What data type would you use to store the number of days till Christmas?
STRING
INTEGER
FLOAT
DATE
What data type for a variable called numberOfLives in a game?
STRING
INTEGER
FLOAT
BOOLEAN
What data type for: age = 15?
STRING
INTEGER
FLOAT
BOOLEAN
What data type for: age = 15?
STRING
INTEGER
FLOAT
BOOLEAN
What does IDE mean?
Integration Development Environment
Integration Device Environment
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?
N
P
T
W
Which of the following decimal (base-10) values is equivalent to the binary (base-2) value 101001?
22
37
41
82
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
B
C
D
Which of the following decimal values, when converted to binary (ignore leading zeros) have exactly 3 zeros in them?
Select two answers.
20
30
40
50
Which of the following decimal values, when converted to binary (ignore leading zeros) have exactly 3 zeros in them?
Select two answers.
20
30
40
50
Binary
A way of representing information using only two options
2
Coding with numbers
How we represent words
ASCII (American Standard Code for Information Interchange)
The universally recognized raw text format that any computer can understand
The only way people communicate on computers
Binary Code
The only way computers communicate messages all the time.
Packets
Small chunks of information that have been carefully formed from larger chunks of information
The material Mr. Ramirez Passes out
The pieces of the internet that get set around
The mail that is being set over the internet.
Transmission Control Protocol
Provides reliable, ordered, and error-checked delivery of a stream of packets on the internet
Tells me how to transmit my messages to other people
What we communicate
Rules for receiving messages
URL
An easy-to-remember address for calling a web page
Universal Reality Language
The way websites talk to each other
The IP address of a website.
HyperText Transfer Protocol
The protocol used for transmitting web pages over the Internet
The protocol that says how fast to send text
The protocol used to by text Hyper
The protocol used to Transfer HyperText
Which of the following are primitive data types in Java?
int
double
char
boolean
word
Which of the following are primitive data types in Java?
byte
long
short
float
number
Evaluate 813 % 100 / 3 + 2.4
6.4
6.73333...
4.4
5.06666...
Evaluate 22 + 4 * 2
30
52
28
30.0
Evaluate 2 * 3 + "." + 4 + 2
"6.42"
"23.42"
"6.6"
"333.6"
What are the values of first and second at the end of the code?
first = 19, second = 8
first = 8, second = 19
first = 27, second = 8
first = 27, second = 19
Which statement(s) are equivalent to i = i + 1?
i += 1
i++
i -= 1
i--
How many times does the for loop run?
2
3
4
5
How many times does the for loop run?
2
3
4
5
How many times does the for loop run?
2
3
4
5
How many times does the for loop run?
2
3
4
5
How many times does the for loop run?
2
3
4
5
How many times does the for loop run?
infinitely
never
How many times does the for loop run?
infinitely
never
If x = 3 and y = 5, choose all the statements that evaluate to True.
x < y
y > -x**2
2 * x == y
y % x == 3
A Boolean expression...
Fixes any errors in the line of code
Sets everything in it equal to each other
Checks if something is true or false
Loops the program to continue infinitely
How many values does a Boolean variable have?
4
3
2
1
Infinite
Which Java type can be used to store a true or false value?
boolean
bool
Boolean
Bool
True/False: The body of an "if" statement will only be executed if the condition is true.
True
False
What is missing from the command: System.___.println("Hello World");
prt()
Sys
java
out
How many classes are required in a Java Program?
At least one.
None, you can run a basic program without a class.
Two, one for the main function and one for the function code.
None of the above.
Which is the correct way to end a command statement in Java?
;
,
.
:
Which of the reserved words is missing in this line which is found in every Java program?
public _____ void main(String[] args) {
private
void
open
static
Which reserved word allows other classes to access your class in Java?
private
call
public
open
Which of these is NOT a primitive datatype in Java?
float
int
String
char
If you wanted to store the value 2.5 in a variable what datatype would you need to use?
char
float
int
boolean
Which boolean operator should replace the @ in this code?
=
<=
==
equal
What is the value of bool after running this code?
true
undefined
false
5 + 7
What is the value of bool after running this code?
true
undefined
false
5 + 7
What is a method?
a tool that makes a program longer
a tool that helps organize behaviors in a program
a tool that makes a program more disorganized
a tool that makes a program harder to read
a tool that complicates a program
What is a class in java?
A template for objects
A room full of chipmunks
A behavior that an object can do
Another name for a variable
What is an object in Java?
A value with a class data type
Another name for a primitive variable
A template for a class
When Java refuses to do what you want
What is concatenation?
When strings are linked together using +
When numbers are added together using +
The nation with cats
What will be printed by the following line of code?
System.out.println("\"ice bear\"");
"ice bear"
ice bear
""ice bear""
"\"ice bear\""
What method can be used to find the absolute value of a number?
Math.pow()
Math.abs()
Math.biceps()
Math.wham()
What kind of data type is used for numbers?
Integer
String
Boolean
Floating Point
What is a blueprint and determines how an object will behave?
Object
Method
Attribute
Class
What is the resulting value of x?
double x;
x = 7;
Error
7
7.0
What does IDE mean?
Integration Development Environment
Integration Device Environment
What data type for a car plate number: plateNumber = "AV01-AFP"?
STRING
INTEGER
FLOAT
DATE
