Java Codelab Solutions - Section 2.1 Java Application Structure
Java Codelab Solutions - Section 2.1 Java Application Structure
Blog Archive
2014
(1)
2013
(132)
October
(21)
September
(105)
60118: An identifier
that cannot be used as a variable name is a reserved word.
60094: A comment
starts with what characters? //
The text of a comment can
be anything the programmer wants to
write.
85016: Of the
following variable names, which is the best one for keeping track of whether a
patient has a fever or not?
hasFever Of the following variable names, which is the
best one for keeping track of whether an integer might be prime or
not? mightBePrime
20503: Write a
statement that prints Hello, world to the screen:
System.out.println( "Hello,
world" );
20504: Write a
complete main method that prints Hello, world to the screen:
System.exit( 0 );
20505: Suppose
your name was Alan Turing. Write a statement that would print your
last name, followed by a comma,
followed by a space and your first name:
System.out.println( "Turing,
Alan" );
20506: Suppose
your name was George Gershwin. Write a complete main method that
would print your last name,
followed by a comma, followed by a space and
your first name:
System.out.println( "Gershwin,
George" );
System.exit( 0 );
20515: Write a
complete program whose class name is Hello and that
displays Hello, world on the screen.
System.exit( 0 );
if/else Statements
public class Q
public
static void main(String[] a)
System.out.println("Q");
20977: Assume
that message is a Stringvariable. Write a statement to
display its value on standard output:
System.out.println(message);
20978: Assume
that word is a
Stringvariable. Write a statement to display the
message "Today's Word-Of-The-Day is: "
followed by the
value of word on a line by itself
on standard output.
System.out.println("Today's
Word-Of-The-Day is: " + word);
Posted by
JavaSolutions
at
11:59 AM
No comments:
Post a Comment
Newer Post
Home
Subscribe to:
Post Comments (Atom)
Older Post
Dimensional Arrays
Section 7.18: Exercises,
Problems, and Projects
Section 7.10 The toString
and equals Methods
Section 7.8 Programming
Activity (Parking Meter)
Section 7.8 Programming
Activity (Book)
Section 7.8 Programming
Activity (Gas Tank)
Section 7.8 Programming
Activity (Value Class)
Section 7.8 Programming
Activity (Counter)
Section 7.7 Writing Data
Manipulation Methods
Section 7.6 Writing
Mutator Methods
Section 7.5 Writing
Accessor Methods
Section 7.4 Writing
Constructors
Section 7.2 Defining
Instance Variables
Section 7.1 Defining a
Class
Section 1.5.4:
Programming Activity 1:
Writing a...
Section 1.5.3: Developing
a Java Application
Section 1.5.2: Program
Design with
Pseudocode
Section 1.5.1:
Programming Basics
Section 1.4.2 An
Introduction to ObjectOriented P...
Section 1.4.1: High and
Low Level Languages
Section 1.3.3:
Representing
Characters with the U...
Section 1.3.2: Using
Hexadecimal Numbers
to Repre...
Section 1.3.1 Binary
Numbers
Section 1.1: Basic
Computer Concepts
Chapter 1: Introduction to
Programming
Chapter 7: ObjectOriented Programming,
Part 2: U...
August
(3)
July
(3)