CSCI 111 FInal Ole Miss (Melody)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/33

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

34 Terms

1
New cards

If I have a file, TestFile.java, what do I type in Command Window to compile the file and run the file?

javac TestFile.java

2
New cards

What are the characteristics of machine language?

The instructions are in the form of binary code. The programs are highly difficult to read and modify

3
New cards

What are the characteristics of assembly language?

Developed to make programming easy. A program called assembler is used to convert assembly language programs into machine code. Symbolic

4
New cards

What are the characteristics of high-level language?

Are English-like and easy to learn and program.

5
New cards

What is 52 % 8?

4 (remainder)

6
New cards

How to concatenate strings in System.out.println ?

+

7
New cards

What is the output of the following code?

int a = 10;

int b = 3;

System.out.println("a/b is" + a/b);

a/b is 3

8
New cards

Which of the following is NOT a valid variable name?

1stHalf

9
New cards

What is the output of the following code?

double a = 6.5;

a += a + 1;

System.out.println(a);

14.0

10
New cards

Analyze the following Java code:

int a = 1;

int b = 2;

int c = 3;

int answer = b-- - a++ * ++c;

What is answer?

4

11
New cards

When displaying output within the quotes, how do you insert a new line?

\n

12
New cards

215 in hexadecimal is what in binary number?

0010 0001 0101

13
New cards

Analyze the following Java code:

int x = 8;

int y = 4;

int z = 2;

double answer = x + y / Math.pow(z, z);

What is answer?

9.0

14
New cards

What is the output of the following fragment?

for(int i=0; i<=15; i++){

if((i%4)==1)

System.out.printf("%d",i);

}

1 5 9 13

15
New cards

Consider the following code that assigns a letter grade to a student's score:

if(score>=90) grade="A";

if(score>=80) grade="B";

if(score>=70) grade="C";

if(score>=60) grade="D";

else grade="F";

This code will work correctly only if grade < 60

16
New cards

Which of the following is the correct expression that evaluates to true if the number x is between 1 and 100 or the number is negative?

((x < 100) && (x > 1)) || (x < 0)

17
New cards

If x = true, y = 10, z = 20, evaluate !x || (y == (z/2)

true

18
New cards

If x = true, y = 10, z = 20, evaluate x && !(y*2 <= z)

false

19
New cards

What is the position of a value in an array called?

20
New cards

A collection of statements that are grouped together to perform an operation

method

21
New cards

Syntax for a method header

modifier returnType methodName (list of formal parameters)

22
New cards

Syntax to call a method with a return value

returnDataType variable = methodName (list of parameters)

23
New cards

Formal parameters and actual parameters must match in _____________, ______________, and _______________.

number, order, and data type

24
New cards

Does a void method have a return statement?

no; the method performs some actions

25
New cards

How do you call a method from a different class?

ClassName.methodName

26
New cards

What are overloaded methods?

Enable you to define the methods with the same name as long as their signatures are different

27
New cards

The part of the program where the variable can be referenced

Scope

28
New cards

A variable defined inside a method

local variable

29
New cards

A data structure that represents a collection of the same types of data

Array

30
New cards

How do you declare an Array

dataType[] arrayRefVar;

31
New cards

What are the values in an array called?

elements

32
New cards

A while-loop is a _________________-controlled loop

event

33
New cards

A for-loop is a ________________-controlled loop

count

34
New cards

A for-loop executes a fixed number of times?

True