CSE 110 Quiz
Which of the following are true? I. Hierarchical folders help to organize a project. II. Folders are a way to visualize the layout of a file system. III. Folders make it impossible to lose or accidentally delete a file.
1,2
What statements about the integrated development environment (IDE) are true? I. You may run Java class files even after exiting the IDE. II. The IDE can invoke a virtual machine, which is required to run a Java program. III. Translating Java source code into class files is enough to then actually run the program
1,2,3
Which of the following are reasons why Java is good, but not perfect, for beginners? I. A certain amount of technical machinery is necessary to write basic, simple programs II. There are many extensions III. There are a large number of extensive libraries in Java
1,2,3
Which statements are true? I. In Java, a file can contain at most one public class II. The word public denotes that the class is usable by the "public" III. Every Java program must have a main method
1,2,3
Which of the following statements regarding backup strategies for Java files are true? I. You should back up your projects often to prevent loss of valuable work. II. You should check your backups only in case of loss of data. III. You should pay attention to the backup direction.
1,3
Which of these are true about writing algorithms in pseudocode? I. The exact wording is not important II. The sequence of steps should be ambiguous III. The algorithm should terminate
1,3
Which of the following typically provides data persistence without electricity? I. The CPU's memory II. The hard disk III. Secondary storage
2, 3
Which of the following are true? I. Computer programs can be written by someone who has a basic knowledge of operating a computer. II. Computer programs can complete complex tasks quickly. III. Large and complex computer programs are generally written by a group of programmers. IV. Computer programs are composed of extremely primitive operations.
2, 3, 4
What is the output of the following code snippet? public class PrintIt { public static void main(String[] args) { System.out.println("4 * 4" + 12); } }
4 * 412
A single silicon chip made from potentially millions of transistors is called
A CPU
High-Level programming languages
Are independent of the underlying hardware
Suppose you examine a simple Java program and the first line is public Class HelloPrinter. Is this the same thing in Java as the line public Class helloprinter?
No, because Java is case-sensitive, these are considered to be completely distinct
The programmer, not the compiler, is responsible for testing a program to identify
Run-time errors
Because Java was designed for the Internet, which two of its attributes make it suitable for beginning programmers?
Safety and portability
Which of the following symbols is use to terminate a Java program statement
Semicolon
A Java virtual machine is:
Software
Which of the following refers to a collection of programs that a computer executes?
Software
Which one of the following errors represents a part of a program that is incorrect according to the rules of the programming language?
Syntax errors
In order to translate a Java program to a class file, the computer needs to have software called a(n):
a compiler
While developing a program, the programmer adds the discount amount to the total due instead of subtracting it. What type of an error is this?
a logic error
An example of an input device that interfaces between computers and humans is
a microphone
Every statement in Java must be terminated with
a semicolon
An example of an output device that interfaces between computers and humans is
a speaker
When a program begins to run,
it is moved to the CPU's memory
Programmers have embraced Java over its closest rival, C++, mainly because
its easier to use
The Java programming language is itself relatively simple, but also contains a vast set of
library packages
Which statement starts the declaration of a class in Java?
public class Classname
The technical term for the values that a method needs in order to carry out its task is an argument. When there is more than one argument needed by a method, they are
separated by commas
Characters that are grouped together between double quotes (quotation marks) in Java are called
strings
In order to run Java programs on a computer, the computer needs to have software called a(n):
virtual machine
In Java, if you want the compiler to interpret what you type as program instructions, you must
write correct Java statements separated by the semicolon
The source code for a Java program is stored in a file that end with a
.java suffix
Which of the following are true I. Computers can execute a large number of instructions in a fraction of a second. II. Computer application areas mainly target the research and scientific communities. III. The physical components of a computer constitute its hardware. IV. Unlike humans, a computer never gets bored or exhausted when performing repetitive tasks.
1, 3, 4
What is the output of the following code snippet? System.out.print(4 + 4); System.out.print(12);
812
What is the difference between an editor and a compiler?
An editor allows program files to be written and stored; a compiler converts program files into an executable program
An integrated development environment (IDE) bundles tools for programming into a unified application. What kinds of tools are usually included?
An editor and a compiler
What is a logic error?
An error that occurs when a program is running because, for example, the wrong operator was used.
Small applications written in the Java programming language that can be located anywhere on the Internet are called
Applets
Every Java program consist of one or more
Classes
What kind of error is it when your program has a syntax error?
Compile-time error
What translate high-level descriptions into machine code
Compiler
The ENIAC computer burned out transistors at the rate of a) ten per day b) one hundred per day c) several per day d) None - it used vacuum tubes
D
Which of the following statements is true with respect to the main method in Java?
Every Java application must have a main method.
What is the output of the following code snippet? System.out.print("Hello"); System.out.println("Good Day!");
HelloGood Day!
Computer scientists have devised something that allows programmers to describe tasks in words that are closer to the syntax of the problems being solved. This is called a(n)
High-Level programing language
A Java class with the name Printer has to be saved using the source file name:
Printer.Java
What is one of the benefits of using a high-level programming language like Java?
Problems solved in a high-level language are independent of the underlying computer hardware
Who or what is responsible for inspecting and testing the program to guard against logic errors?
Programmer
Prints a blank line in Java...
System.out.print();
How do programmers find exceptions and run-time errors?
Testing by running the program with a variety of input values
Consider a scenario in which you develop a Java program on a computer that has a Pentium processor. What step should you take to run the same Java program on a computer that has a different processor?
The compiled Java machine language instructions can be run on any processor that has a Java Virtual Machine
When a compiler finds a syntax error in a program, what happens?
The compiler continues and may report about other errors but does not produce a Java class file.
The term "applet" refers to
a Java program that runs within a web browser
In order for Java to achieve portability...
compiled Java Programs contain instructions for a virtual machine
Computer are machines that?
execute programs
Programs that are not running are usually stored
in secondary storage
In Java, the statement System.out.print("hello");;;
is a legal statement
The Central Processing Unit is primarily responsible for?
performing program control and data processing
Computer Programming is?
the act of designing and implementing a computer program