Flashcards
CSE 110 Chapter 01 Review
Cards in this deck (83)
- 11) Which of the following refers to a collection of programs that a computer executes? a) Software b) Assembler c) Instructions d) Source codea
- 22) Computers are machines that a) design computer programs. b) execute programs. c) carry out a very narrow range of tasks. d) are imprecise and slow.b
- 33) Computer programming is a) the speed with which a computer operates. b) the collection of peripheral devices connected to a computer. c) the storage of data in the form of words and pictures. d) the act of designing and implementing a computer program.d
- 44) Consider the following statements regarding computers: 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. Which one of the following options is correct? a) Only III is a valid statement. b) I and III only are valid statements. c) I, II, and III only are valid statements. d) I, III, and IV only are valid statements.d
- 55) Consider the following statements about computer programs: 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. Which one of the following options is correct? a) II and III only are correct statements. b) I, II, III and IV are correct statements. c) II, III, and IV only are correct statements. d) I and IV only are correct statements.c
- 66) The Central Processing Unit is primarily responsible for a) performing program control and data processing. b) ensuring data persists when electrical power is turned off. c) enabling a human user to interact with the computer. d) interconnecting computers that are separated by distance.a
- 77) A single silicon chip made from potentially millions of transistors is called a) a Central Processing Unit (CPU). b) secondary Storage. c) a Hard Disk. d) an Optical Disk (such as a DVD).a
- 88) An example of an output device that interfaces between computers and humans is a) a keyboard. b) a mouse. c) a speaker. d) a microphone.c
- 99) An example of an input device that interfaces between computers and humans is a) a microphone b) a monitor c) a printer d) a speakera
- 1010) Programs that are not running are usually stored a) in the CPU’s memory. b) on the computer monitor. c) in secondary storage. d) on a backup device that is in a different physical location from the computer.c
- 1111) When a program begins to run, a) It is moved from DVD to hard disk. b) It is moved to the CPU’s memory. c) It is moved from the CPU’s memory to hard disk. d) It must be connected to a computer network.b
- 1212) Which one of the following typically provides data persistence without electricity? I. The CPU’s memory II. The hard disk III. Secondary storage a) I, II only b) I, III only c) II, III only d) I, II, IIIc
- 1313) 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? a) The compiled Java machine language instructions can be run on any processor that has a Java Virtual Machine. b) Develop the same program again on the computer that has a different processor and recompile the program. c) Recompile the program on the computer that has a different processor. d) You cannot run the program on a computer with a different processor because high-level programming languages are machine dependent.a
- 1414) High-level programming languages a) Are made up primarily of ones and zeros b) Are independent of the underlying hardware c) Are not standardized d) Use syntax that is close to the underlying hardware’s instruction setb
- 1515) Which one of the following translates high-level descriptions into machine code? a) Assembler b) Linker c) Compiler d) Editorc
- 1616) 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) a) Embedded system b) Machine instruction c) High-level programming language d) Compilerc
- 1717) Small applications written in the Java programming language that can be located anywhere on the Internet are called a) Applets b) Compilers c) Embedded systems d) Virtual machinesa
- 1818) What is one of the benefits of using a high-level programming language like Java? a) Its syntax is very similar to the hardware instruction set b) No tools other than a text editor are required for programming c) Statements in the high-level language are just like English d) Problems solved in a high-level language are independent of the underlying computer hardwared
- 1919) Because Java was designed for the Internet, which two of its attributes make it suitable for beginning programmers? a) Efficiency and portability b) Safety and security c) Safety and portability d) Efficiency and securityc
- 2020) An integrated development environment (IDE) bundles tools for programming into a unified application. What kinds of tools are usually included? a) An editor and a compiler b) A web browser c) Presentation tools d) Source files and class filesa
- 2121) 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 a) I, II only b) I, III only c) II, III only d) I, II, IIId
- 2222) What is the difference between an editor and a compiler? a) An editor converts program files into an executable program; a compiler allows program files to be written and stored b) An editor allows program files to be written and stored; a compiler produces an organized list of files c) An editor allows program files to be written and stored; a compiler produces an indexed database of terms and keywords d) An editor allows program files to be written and stored; a compiler converts program files into an executable programd
- 2323) 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? a) No, because Java is case-sensitive, these are considered to be completely distinct b) No, because “helloprinter” is misspelled, the Java compiler will reject it c) Yes, because these Java symbols both have the same letters, they are considered to be the same d) Yes, because all Java symbols must have exactly twelve characters.a
- 2424) 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. a) I, II only b) I, III only c) II, III only d) I, II, IIId
- 2525) Consider the following statements about folders and your integrated development environment (IDE): 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. a) Only I is correct b) I, II, and III are correct c) Only I and II are correct d) Only III is correctc
- 2626) 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. a) I, II only b) I, III only c) II, III only d) I, II, IIIb
- 2727) Every Java program consists of one or more a) Values (arguments) b) Classes c) Strings d) System.out.println statementsb
- 2828) Characters that are grouped together between double quotes (quotation marks) in Java are called a) reserved words b) syntax c) symbols d) stringsd
- 2929) Every statement in Java must be terminated with a) the semi-colon character ;. b) a carriage return. c) System.out.println(). d) an escape sequence.a
- 3030) These two lines of code do not produce the same output. Why? System.out.println(7 + 3); System.out.println("7 + 3"); a) Arithmetic calculations cannot take place within the println method call. b) In fact, the two statements do produce the same output. c) The quotes cause the second expression to be treated as a string. d) Because there are no escape characters.c
- 3131) What is the output from this code snippet? System.out.print("The sum is "); System.out.println("7 + 3"); a) The sum is 10 b) The sum is 21 c) The sum is 4 d) The sum is 7 + 3d
- 3232) Which of the following symbols is used to terminate a Java program statement? a) Colon b) Semicolon c) Single quote d) Periodb
- 3333) Which of the following statements is valid with respect to the usage of a semicolon in Java? a) A semicolon is used to denote the end of a statement. b) A semicolon is used to terminate the public class statement. c) You cannot use a semicolon to terminate the System.out.print statement. d) You cannot put a semicolon within double quotation marks.a
- 3434) Which of the following statements is true with respect to the main method in Java? a) The opening and closing parentheses after the method name main are optional. b) A semicolon is required after the statement public static void main() c) A semicolon is required after the closing curly braces in the main method. d) Every Java application must have a main method.d
- 3535) A Java class with the name Printer has to be saved using the source file name: a) printer.java b) Printer.java c) Printer.txt d) printer.javab
- 3636) Which statement starts the declaration of a class in Java? a) public static void main(String[] args) b) public class Classname c) System.out.println("Hello, World!"); d) Java classb
- 3737) Which Java statement prints a blank line? a) public static void main(String[] args) b) System.out.print(); c) System.out.println(); d) System.out.Println();c
- 3838) Which Java statement does not contain an error? a) System.out.print(; b) System.out.print() c) System.out.printl(); d) System.out.println();d
- 3939) What is the output of the following code snippet? System.out.print(4 + 4); System.out.print(12); a) 4 + 412 b) 4412 c) 812 d) 20c
- 4040) What kind of error is it when your program has a syntax error? a) Compile-time error b) Logic error c) Run-time error d) Exceptiona
- 4141) When a compiler finds a syntax error in a program, what happens? a) The compiler goes ahead and produces a Java class file, but leaves out the statement where there was an error. b) The compiler stops immediately. c) The compiler requests input from the user before it will continue. d) The compiler continues and may report about other errors but does not produce a Java class file.d
- 4242) What kind of error is created by the following code snippet? System.outt.println("Hello"); a) No error: the code is correct b) Logic error: the program will run until it comes to this statement c) Syntax error: the program will not compile d) Exception: the statement will generate an exceptionc
- 4343) What kind of error is created by the following code snippet? System.out.print("The sum of 8 and 12 is "); System.out.println(8 * 12); a) No error: the code is correct b) Logic error: the program does not produce the desired result c) Syntax error: the code will not compile d) Exception: the statement will generate an exceptionb
- 4444) What is a logic error? a) An error that occurs when a program is running because, for example, the wrong operator was used. b) An error in a statement that does not conform to the syntax of the programming language. c) An error in the hardware from overheating. d) An error introduced by the compiler when it guesses at how to fix a syntax error.a
- 4545) How do programmers find exceptions and run-time errors? a) Using the compiler b) Testing by running the program with a variety of input values c) Carefully reading over the program code d) Re-compiling using different symbolsb
- 4646) The programmer, not the compiler, is responsible for testing a program to identify a) Syntax errors b) Compile-time errors c) Run-time errors d) Undefined symbolsc
- 4747) Which one of the following errors represents a part of a program that is incorrect according to the rules of the programming language? a) Syntax errors b) Run-time errors c) Logic errors d) Out-of-memory errorsa
- 4848) Who or what is responsible for inspecting and testing the program to guard against logic errors? a) Programmer b) Integrated Development Environment c) Compiler d) End-usera
- 4949) 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) A syntax error b) A logic error c) A hardware error d) A compile-time errorb
- 5053) Which one of the following methodologies is a sequence of steps formulated in English for solving a problem? a) Flowcharts b) Pseudocode c) Algorithms d) Terminationsb
- 5163) In order to run Java programs on a computer, the computer needs to have software called a(n): a) assembler b) virtual machine c) windows d) debuggerb
- 5264) In order to translate a Java program to a class file, the computer needs to have software called a(n): a) assembler b) virtual machine c) compiler d) debuggerc
- 5365) The Java statement public static void main(String[] args) declares a: a) class b) variable c) constant d) methodd
- 5466) A Java virtual machine is: a) Software b) Hardware c) Firmware d) Appleta
- 5567) Which of the following statements must you include in a Java class that can be executed by the virtual machine? a) System.out.println(); b) // Hello c) public static void main(String[] args) d) return 0;c
- 5668) What is the output of the following code snippet? System.out.print("Hello"); System.out.println("Good Day!"); a) Hello Good Day! b) Hello Good Day! c) HelloGood Day! d) HelloGoodDay!c
- 5769) Which one of the following code snippets compiles without errors and displays the output “Hello Good Day!” on the screen? a) System.out.print("Hello "); System.out.println("Good Day!"); b) System.out.print("Hello ); System.out.println("Good Day!"); c) System.out.print("Hello "); System.out.println("Good Day!") d) System.out.print("Hello "); System.out.println(Good Day!");a
- 5870) What is the output of the following code snippet? public class PrintIt { public static void main(String[] args) { System.out.println("4 * 4" + 12); } } a) 4 * 412 b) 4412 c) 1612 d) 28a
- 5976) Writing a computer game in Java that has graphics, motion, and sound effects a) is simple because of the power of Java b) requires a team of skilled programmers c) cannot be done in the Java programming language d) is more mundane than most programsb
- 6077) Which option correctly completes this statement? Programs can repeat simple instructions very quickly to I. help human users to perceive images and sound II. remove the drudgery of repeating instructions by hand III. overcome the need for connectivity to the computer network a) I, II only b) I, III only c) II, III only d) I, II, IIIa
- 6178) 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 tubesd
- 6279) In order for the ENIAC computer to be re-programmed a) vacuum tubes needed to be replaced b) wires needed to be plugged into a different wiring configuration c) the programmer needed to load the program from cards d) the programmer needed to download the new code over the computer networkb
- 6380) The language developed by Sun Microsystems that became the Java programming language was originally designed to be simple, secure, and a) easy to use in any language b) available over the Internet c) usable for many different processor types d) environmentally friendly, or "green"c
- 6481) The term “applet” refers to a) a Java program b) a Java program that runs as a C++ program c) a Java program that runs within an Integrated Development Environment (IDE) d) a Java program that runs within a web browserd
- 6582) Programmers have embraced Java over its closest rival, C++, mainly because a) it is easier to use b) it is easier to debug c) it is cheaper to use d) most computers only understand Javaa
- 6683) Java is said to be a "safe" programming language. What does this mean? a) Java programs cannot cause environmental damage because they are "green". b) Java programs can run within a browser without fear that they may attack your computer. c) There is no way for a Java program to read or write a file. d) Java programs cannot access data across a computer network.b
- 6784) In order for Java to achieve portability a) compiled Java programs contain instructions for a virtual machine b) Java is not compiled c) Java programs must be re-compiled on each platform where they are to run d) Java programs are based on the C++ programming languagea
- 6885) A Java Virtual Machine is a) A theoretical machine to help understand the computational complexity of algorithms b) A program that simulates a real CPU c) A kind of computer hardware that is embedded into the CPUs of all computers using Java d) A library package that extends the capability of the Java programming languageb
- 6986) The Java programming language is itself relatively simple, but also contains a vast set of a) syntactical variations b) program templates c) cross-platform scripting languages d) library packagesd
- 7087) The source code for a Java program is stored in a file a) that ends with a .class suffix b) that can have any valid file name c) that ends with a .java suffix d) that has no suffixc
- 7188) A Java "class" file a) contains Java source code b) contains instructions to the Java virtual machine c) is an internal file created by the Integrated Development Environment (IDE) d) is the translation of the Java source code into C++b
- 7289) Which pointers about backing up your Java projects are important? I. Check your backups once in a while II. Rely on the Java programming language's built-in back up system III. Back up often a) I, II only b) I, III only c) II, III only d) I, II, IIIb
- 7390) 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 a) I, II only b) I, III only c) II, III only d) I, II, IIId
- 7491) 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 a) separated by semicolons b) separated by spaces c) separated by commas d) merged into a single variablec
- 7592) In Java, if you want the compiler to interpret what you type as program instructions, you must a) enclose those instructions within quotation marks b) start the line that you type with the symbols // c) write the instructions in all capital letters d) write correct Java statements separated by the semicolond
- 7693) In Java, the statement System.out.print("hello");;; a) is a syntax error b) is a legal statement c) seems like it should print out "hello" but doesn't d) asks the user to enter a value and stores it in the variable "hello"b
- 7794) Sometimes errors throw the compiler off track because a) the compiler does not give up when it finds the first error b) the compiler must be trained by your programming style c) the compiler does not understand quotation marks d) it cannot tell which language you are writing without a network connectiona
- 7895) Some run-time errors are so severe that they generate a) an exception b) an email to your account c) the loss of your source code file d) a syntax errora
- 7996) During program development, errors are a) very rare b) prevented by the compiler c) automatically tracked by the Integrated Development Environment (IDE) d) unavoidabled
- 8097) If you misspell a word in your Java program it may be true that I. the program will not compile II. the program may compile, but not run III. the program may compile and run but still have a logic error a) I, II only b) I, III only c) II, III only d) I, II, IIId
- 8198) 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 a) I, II only b) I, III only c) II, III only d) I, II, IIIb
- 82100) A sequence of steps that is unambiguous, executable, and terminating is called a) pseudocode b) an algorithm c) a logarithm d) a programming taskb
- 83101) The first step in describing an algorithm in pseudocode is a) break the algorithm into smaller pieces b) test the algorithm by working a problem c) write the steps out in Java code d) determine the inputs and the outputsd
Information
- Description
- CSE 110 (Review) Flashcards on CSE 110 Chapter 01 Review, created by Branden Roper on 01/10/2017.
- Created by
- Branden Roper
- Views
- 3
- Tags
- Rating