Comp Sci Midterm
Which operator is used for modulus division?
%
Which expression does not evaluate to 0.6?
(double) (6 / 10);
Which is not a correct Java comment?
** comment
What does HTML stand for?
Hypertext Markup Language
Real division returns the entire quotient, including the decimal portion.
True
The statement numPlayers += 2; is the same as numPlayers = numPlayers + 2;
True
Values represented by the double data type are referred to as floating point.
True
When displaying the following HTML code in a Web Browser, the list will be displayed as an ordered list.
True
Which character is an escape sequence?
\
Which keyword does a constant declaration begins with?
final
Which statement declares a constant named PRICE with a value of 5.25?
final double PRICE = 5.25;
Which method controls the way output is displayed?
format()
Which is used to enclose single or multiline comments?
/* */
How many values can a variable store at one time?
1
What is the final value of finalNumber after the last statement executes?
10
What is the result of the following expression when x is 3576? (x/10)%10
7
Which operator is used to assign a new value to a variable?
=
What is the correct HTML for creating a hyperlink?
A href="http://www.w3schools.com">W3Schools
How do you change the text color of an element?
Color:
A constant value can be changed from its initial assignment.
False
A program containing syntax errors will compile.
False
An abstract data type is also called a primitive data type.
False
Comments affect the execution of a program.
False
If a value could possibly have a decimal portion, int is the best data type choice.
False
In a format string specifier, a - indicates right alignment.
False
Modulus division truncates the decimal portion of the quotient to result in an integer.
False
Multiple variables with different data types can be declared in a single statement.
False
Statements must end with a period.
False
The following shows correct usage of html code.
False
The identifiers Widgets and widgets are considered the same in Java.
False
There is no difference between the print() and println() methods.
False
Using the Scanner class in an application does not require an import statement.
False
When displaying the following HTML code in a Web Browser, the list will be displayed as a bulleted list.
False
Which CSS property controls the text size?
Font-size
How do you make the text bold in CSS?
Font-weight:bold
Choose the correct HTML tag for the largest heading
H1
Which heading tag will create the largest heading?
H1 Tag
How do you add a background color for all elements?
H1 {background-color:#FFFFFF}
What tag will have the information that will be displayed in the Web page?
HTML Tag
Which should be used to let a user know what input is expected in an application?
a prompt
Which is the correct CSS syntax?
body {color: black;}
Which data type declares a variable that stores a true or false value?
boolean
What is the correct HTML tag for inserting a line break?
br /
</body> is example of an
closing tag
Which is a set of guidelines for writing an application?
code conventions
Which process converts source code to code that the computer understands?
compiling
Which is not a primitive data type?
constant
Which statement is used to make the members of a package accessible to an application?
import
Which data type declares a variable that stores a positive or negative whole number?
int
Which is a valid declaration statement?
int height, width;
Which is another name for package?
library
Which method displays output to the screen and then moves the insertion point to the next line?
println()
Which statement assigns the value 15 to radius?
radius = 15;
Sets of instructions in program code are called
statements
What CSS Rule will change all elements in a html webpage?
tag
What does CSS stand for?
Cascading Style Sheets
<body> is example of an
opening tag
Which property is used to change the background color?
Background-color:
What tag will create a line break?
Break tag
What tag usually contains information about the document that will not appear in the Web page?
Head Tag
Choose the correct HTML tag to make a text italic
I
Which of the following represent correctly-formed comments?
I and III only
What is the correct HTML for inserting an image?
Img src="image.gif" alt="MyImage"
Which describes the output displayed by the statement: System.out.format("%-10s %-10s %8s", "Item", "Quantity", "Cost\n");
Item and Quantity will be left aligned, Cost will be right aligned.
What is wrong with the following html code?
Missing the closing body tag
Does the following show correct usage of adding color to HTML code? (Links to an external site.)Links to an external site. (Links to an external site.)Links to an external site.
No
How can you make a list that lists the items with numbers?
OI
Java was developed by
Sun Microsystems.
Which statement displays Hello, world! on the screen?
System.out.println("Hello, world!")
What effect does \n have when included in an output string?
Output is moved to the next line.
What is the correct CSS syntax for making all the elements bold?
P {font-weight:bold}
What CSS rule would you use only once in an entire HTML webpage?
Tag
What happens to the decimal portion of a number when a double is cast to an int?
The decimal portion is truncated.
What tag will have the information that will appear in the title bar of the Web Page?
Title Tag
A double value can be cast to an int.
True
A variable is a name for a value stored in memory.
True
A variable must be declared before it is used.
True
An escape sequence must be used to display a double quotation mark (").
True
Casting allows real division to be performed on integers.
True
Classes are required to create objects.
True
Java is an object-oriented programming language.
True
Programs are created to solve problems.
True
The equal sign operator is used to assign a new value to a variable.
True
The following show correct usage of HTML code?
True
The format() method can be used to control the way output is displayed.
True
The order of operations can be changed by including parentheses.
True
How can you make a list that lists the items with bullets?
UI
Which occurs in a statement that violates the rules of Java?
a syntax error
Which is a set of steps that tell how to solve a problem?
algorithm
Choose the correct HTML tag to make a text bold
b