Pre-AP Computer Science 1 Semester 1 Examination Review (ExpoJava Ch. 2-4)

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

What does RAM stand for?

(...I already answered this...) Random-Access Memory

Which math operator symbol is used in Java for multiplication?

*

What are the rules for naming an identifier?

-must start with a letter -no spaces -no symbols -only numbers and letters

List 3 examples of Java reserved words

-public -static -void

List the 3 categories of keywords

-reserved words -predefined Java identifiers (print and println) -user defined identifiers

What is the output of this program? int a, b; a=b=30 a /=3; b /=5; int c=a-b; System.out.println(c);

...

All byte code files end with what suffix?

.class

All Java programs end with what suffix?

.java

What is the difference between the / and the % division operators?

/ counts how many whole times % remainder after the division

Which symbol is the single-line comment symbol in Java?

//

What is the difference between a double slash (//) comments and slash star star slash comments (/* */)?

// = one line comment /* */ = multi line comment

What ASCII range is used for the "standard set of characters"?

0-127 characters

What ASCII range is used for the "extended set of characters"?

128-255 characters

What is the output of this program? int a=4; int b=3; a *=3; b *=2; int c=a+b; System.out.println(c);

18

What is "2" + "3"?

23

What is the output of this program? double PI=3.14159; System.out.println(PI);

3.14159

What is the output of this program?

300 (..I think..)

What is the output of this program? int q=24; q /=4; q--=4 System.out.println(q);

5

Translate 7abc into Java source code

7*a*b*c

What is bytecode?

A low-level code file that cannot execute as a regular machine code file

What does ASCII stand for?

American Standard Code for Information Interchange

Spreadsheets and word processors are examples of what kind of software?

Application software

Today in computer science, a data type that has only two values of true and false is called a ___________ data type.

Boolean

What type of code is created by a Java compiler?

Bytecode

What does hardware involve?

CPU, motherboard, RAM, PC with chips (physical machinery and devices that make up a computer system)

What does CPU stand for?

Central Processing Unit

What is the output of this program segment? // System.out.println("Computer"); // System.out.println("Science");

Computer Science

What is the output of this program segment? System.out.println("Computer Science");

Computer Science

List 3 major operating systems.

DOS, Microsoft Windows, Linax

What are the 3 steps of a Java program?

Edit, Compile, Execute

Should Java shortcuts be combined with other Java statements?

Example: System.out.println(x++); No

What does GUI stand for?

Graphical User Interface

Refer to the previous question. Some software packages combine all 3 of these things into an IDE.

Integrated Development Enviroment

What is the name for the interpreter that takes the bytecode and then executes the program?

JVM

What does JDK stand for?

Java Development Kit

What does JRE stand for?

Java Runtime Environment

What does JVM stand for?

Java Virtual Machine

What does software involve?

Java and C++ (programs and instruction used to run a system)

What does println() do when there is nothing between the parentheses?

Keep a space in all of those lines/Will be a blank space

Every application program has a _________ segment.

Main

Are comments complied into byte code?

No

Can Notepad be used to write a Java program?

No

Does the computer understand bytecode?

No

What does OOP stand for?

Object-Oriented Program

Class and method containers start and end with what symbols?

Open and closed braces {}

What does system software involve?

Operating system/utlities that enable computer to function

What does the System.out.println() do?

Output the parameter which is in the parenthesis on the next line/newline

What is the output of this program? double PI=3.14159; System.out.println("PI");

PI

Two or more keywords combine to make what?

Programming Statement

What kind of chip stores temporary information for the computer?

RAM

What kind of chip stores permanent information for the computer?

ROM

What does RAM stand for?

Random-Access Memory

What does ROM stand for?

Read-Only Memory

What is a Java keyword?

Reserved word that has a predefined meaning in the language

Name the 3 Java program keyword categories?

Reserved words, predefined Java identifiers, User defined identifiers

What does "platform independent" mean?

Same program works on any platform (operating system) without needing any modification

What happens to RAM if the computer loses power?

Since it is tempoary, nothing will be stored, it will go away forever and will not be able to be retrieved. (So sucks to suck...)

Both print and println follow what Java keywords?

System and out

What does computer software do?

System software-operating system/utlities that enable computer to function Application software-includes program that do work for users to function

Which files have been complied? Tara.class Yanvi.class Dipali.class Yash.java Jeegn.class Darshan.class Neel.java Mansi.java

Tara.class Jeegn.class Darshan.class Yanvi.class Dipali.class (you see what I did there...because we are all in the class) (that was so punny..so was that.)

If you see public class Tara in your program, what file name must the file have?

Tara.java

What is wrong with this program?

They don't have the same class and file name.

Why is the JRE necessary?

To run Java programs that have already been created

What does Java use an interpreter for?

To translate and execute bytecode files

What does URL stand for?

Universal Resource Locator

When is a programming language considered to be platform independent?

When it doesn't need modification

What does it mean when we say that keywords in Java are "case-sensitive"?

Words don't mean the same thing i.e Sam doesn't equal sam

Are Java keywords case sensitive?

Yes

Can the Java compiler be accessed from the Command Prompt?

Yes

Does Java follow the same Order of Operations that you learned in math class?

Yes

What is a "high-level" language?

a programming language that provides abstraction from a computer's instruction set architecture (Java or C++)

What is a "low-level" language?

a programming language that provides little or no abstraction from a computer's instruction set architecture (Altair)

In the statemen: double x=Math.sqrt(1024); a. Math is the b. Which work is a synonym for parameter?

a. object/class b. 1024

What does x++; or ++x; mean?

add one

What are the 5 integer operations?

addition, subtraction, multiplication, integer division, remainder division

What is accomplished by the statement: c1 = c2 = c3 = 'Q';?

all take on the value of Q

What is "bit" and abbreviation for? How many bits are in a byte?

binary digit, 8 bits in a byte

The CPU is essentially the ______ of the computer.

brain/central unit

List Java's 4 integer types

byte, short, int, long

Which data type would be ideal for storing a Middle Initial?

char

What is the fancy name for using the plus (+) sign to join strings together?

concatenation

Which is more accurate: float or double?

double

When you are creating User-Defined Identifiers, you must make sure your identifier is not one of what two things?

either a reserved word or a predefined identifier

What happens when you attempt to alter the value of a final variable?

error

'7' is what kind of data type value?

int

Print the Java statement that will declare x as an integer

int x

Print a statement that will assign the value of 7 to int x

int x = 7;

Print the Java statement that will declare x as an integer and assign the value of 7 to x in one single statement

int x = 7;

List 7 keywords.

int, long, double, float, boolean, class

Explain the difference between an interpreter and a compiler.

interpreter translates and executes byte code file, while compiler only translates the source code

Java uses a ______ to translate the program source code created by the programmer into ______.

interpreter, bytecode

A program is made up of words, which usually are called what?

keywords

What is the main board in a computer, with all the primary computer components, called?

motherboard

How is Unicode different from ASCII?

newer and stores more information

What does the escape sequence \n do?

newline/next line

What is the first Java syntax rule?

no spaces

The plus (+) sign can be used to add integers and real numbers. It can also be used to join strings. What is it called when one operator can perform different functions?

overloading

What is Java's formal language for the term simple data types.

primitive

List 2 examples of predefined indentifiers.

print and println

Explain the difference between print and println.

print outputs on the same line while println outputs on the next line

What punctuation symbols must be at the end of all Java program statements?

semicolon ;

What does x--; or -x; mean?

subtract one

What 3 things do you need to write a Java program?

text editor, compiler, interpreter

Refer to the previous question. Java then continues and uses an ________ to translate the ______into executable ________ line by line.

translator, bytecode, machine code

Define the word "program"

type of software that provides a computer with coded instructions for the automatic preformance of task

What does x%=5; mean?

x = x%5

What does x*=5; mean?

x = x*5

What does x-=5; mean? x = x-5

x = x-5

What does x+=5; mean? x = x+5

x=x+5

What does x/=5; mean?

x=x/5


Kaugnay na mga set ng pag-aaral

C172 Lesson 5 (Quizzes, Exercises, Labs)

View Set

Article 6 of US Constitution And Commerce Clause

View Set

Operation of three phase induction motors (12hrs)

View Set

تصميم خرساني مسلح2

View Set