COMPUTER SCIENCE FINAL EXAM
question with answers
Define the word "program". - - A set of instructions to achieve a specified goal.
-Explain why programming in machine language is undesirable - - Programming is
1s and 0s is very tedious and problematic.
-What language uses commands with mnemonic names and hexadecimal
numbers? - - Assembly language
-What is the name of the translator used by Assembly Language? - - Assembler
-List 2 of Grace Hopper's accomplishments. - - Developed program translators &
Developed COBOL
-Explain the difference between an interpreter and a compiler. - - Compilers
translates the entire file and then execute.
Interpreters translate each line and execute each line
-What is a "low-level" language? - - Close to computer language
-What is a high-level language? - - Close to human language
-Why do we not simply use English, or any other human language, to program a
computer? - - English is too ambiguous
-What was the first successful programming language for the mathematics and
scientific
Community language? - - FORTRAN
-What does FORTRAN stand for? - - Formula Translator
-What community was COBOL created for? - - business
-A program is made up of words, which usually are called what? - - Keywords
-What is the first Java syntax rule? - - Use only keywords known by the Java
compiler.
-List the 3 categories of keywords. - - Reserved words, pre-defined identifiers and
user-defined identifiers
-List 3 examples of Java Reserved Words - - public, static, void
-Java has a large number of libraries that enhance the basic Java language. These
libraries contain
, special program modules that perform a variety of tasks to simplify the life of a
programmer. What
are these modules called? - - methods
-List 2 examples of Predefined Identifiers. - - print and println
-What does OOP stand for? - - Object Oriented Programming
-What is the difference between C++ and Java with regards to OOP? - - C++ gives
you the option to use OOP. Java requires it.
-What are the 4 stages of program design? - - Cryptic Programming Stage
Unstructured, Spaghetti-Programming Stage
Structured Programming Stage
Object Oriented Programming Stage
-Why were some programs intentionally written very cryptic in the 1st stage of
program design? - - Many programs were written intentionally in a very cryptic
style that only the creator of the
program could understand
-Why did the first stage of program design not last long? - - Computers became
cheaper and programmers became more expensive. Programs required
frequent debugging and updating, and the cryptic style usually meant starting a
program from
scratch if the creator left the company. Companies could not afford this wasteful
approach.
-What quick fix statement was used in the 2nd stage of program design? - - goto
-What is the simplest control structure? - - for
-Write the Java statement that will do this action: If your grade is 70 or better, print
"You passed!" - - if (grade >= 70)
System.out.println("You passed");
-Why should indentation be used with control structures? - - It makes the program
more readable.
-Explain the unusual output of program Java0507. - - The program is meant to
execute multiple statements only if the condition is true.
-What do you need to add to a program if you wish to control multiple statements
with if. - - Create block structure with opening and closing braces.
-What statement is used with if for two-way selection? - - else
-Objects contain data and what else? - - methods
question with answers
Define the word "program". - - A set of instructions to achieve a specified goal.
-Explain why programming in machine language is undesirable - - Programming is
1s and 0s is very tedious and problematic.
-What language uses commands with mnemonic names and hexadecimal
numbers? - - Assembly language
-What is the name of the translator used by Assembly Language? - - Assembler
-List 2 of Grace Hopper's accomplishments. - - Developed program translators &
Developed COBOL
-Explain the difference between an interpreter and a compiler. - - Compilers
translates the entire file and then execute.
Interpreters translate each line and execute each line
-What is a "low-level" language? - - Close to computer language
-What is a high-level language? - - Close to human language
-Why do we not simply use English, or any other human language, to program a
computer? - - English is too ambiguous
-What was the first successful programming language for the mathematics and
scientific
Community language? - - FORTRAN
-What does FORTRAN stand for? - - Formula Translator
-What community was COBOL created for? - - business
-A program is made up of words, which usually are called what? - - Keywords
-What is the first Java syntax rule? - - Use only keywords known by the Java
compiler.
-List the 3 categories of keywords. - - Reserved words, pre-defined identifiers and
user-defined identifiers
-List 3 examples of Java Reserved Words - - public, static, void
-Java has a large number of libraries that enhance the basic Java language. These
libraries contain
, special program modules that perform a variety of tasks to simplify the life of a
programmer. What
are these modules called? - - methods
-List 2 examples of Predefined Identifiers. - - print and println
-What does OOP stand for? - - Object Oriented Programming
-What is the difference between C++ and Java with regards to OOP? - - C++ gives
you the option to use OOP. Java requires it.
-What are the 4 stages of program design? - - Cryptic Programming Stage
Unstructured, Spaghetti-Programming Stage
Structured Programming Stage
Object Oriented Programming Stage
-Why were some programs intentionally written very cryptic in the 1st stage of
program design? - - Many programs were written intentionally in a very cryptic
style that only the creator of the
program could understand
-Why did the first stage of program design not last long? - - Computers became
cheaper and programmers became more expensive. Programs required
frequent debugging and updating, and the cryptic style usually meant starting a
program from
scratch if the creator left the company. Companies could not afford this wasteful
approach.
-What quick fix statement was used in the 2nd stage of program design? - - goto
-What is the simplest control structure? - - for
-Write the Java statement that will do this action: If your grade is 70 or better, print
"You passed!" - - if (grade >= 70)
System.out.println("You passed");
-Why should indentation be used with control structures? - - It makes the program
more readable.
-Explain the unusual output of program Java0507. - - The program is meant to
execute multiple statements only if the condition is true.
-What do you need to add to a program if you wish to control multiple statements
with if. - - Create block structure with opening and closing braces.
-What statement is used with if for two-way selection? - - else
-Objects contain data and what else? - - methods