CSCI 1301 Midterm + Final

0.0(0)
studied byStudied by 5 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/140

flashcard set

Earn XP

Last updated 2:32 PM on 12/10/22
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

141 Terms

1
New cards
Computer systems consist of ____ and ____
hardware, software
2
New cards
hardware includes the ____ parts of computer systems while software includes ____ - sets of instructions for the computer to follow
tangible, programs
3
New cards
Modern computers have what four main things
input, output, processors, memory
4
New cards
what does the CPU do
processes a program's data
5
New cards
T/F the processor can process complex instructions
false
6
New cards
what does the power of computing come from what two things
speed, program intricacy
7
New cards
memory holds what three things
programs, data for computer to process, results of intermediate processing
8
New cards
main memory is known as
RAM
9
New cards
main memory is ____ memory which stores data on the current program
working
10
New cards
what is main memory usually measured in
MB
11
New cards
Auxiliary Memory (Secondary Memory) is known as
ROM
12
New cards
Auxiliary Memory (Secondary Memory) is usually measured in
GB
13
New cards
which memory is more expensive...main or auxiliary
main
14
New cards
which memory is permanent...main or auxiliary
auxiliary
15
New cards
which memory includes CDs, DVDs, flash drives, etc...main or auxiliary
auxiliary
16
New cards
which memory is fast access...main or auxiliary
main
17
New cards
A bit is a digit with a value of ____ or ____
0, 1
18
New cards
a byte consists of ____ bits
8
19
New cards
data is stored in ____'s and _____'s. Several bytes are stored in ________ of bytes
0, 1, groups
20
New cards
large groups of bytes in auxiliary memory are called ____
files
21
New cards
files are organized into ____ or ____
directories, folders
22
New cards
a ____ is a set of instructions for a computer to follow
program
23
New cards
the ____ ____ is a supervisory program that oversees the operation of the computer
operating system
24
New cards
examples of high-level languages
Java, C#, C++, Visual Basic, Python, and Ruby
25
New cards
how is a high level language converted to a low-level language
compiler
26
New cards
what is the product after you compile java code
Java Byte-Code
27
New cards
Y/N after compiling java code into java byte-code, can the code be used anywhere in the world
yes
28
New cards
the person who writes a program is called the
programmer
29
New cards
the person who interacts with the program is called the
user
30
New cards
the items inside the parenthesis are called
arguments
31
New cards
a ____ is a library of classes that have already been defined
package
32
New cards
write the code to import the Scanner package
import java.util.Scanner;
33
New cards
a ____ is something that can store data
variable
34
New cards
an instruction to the computer is called a ____; it ends with a semicolon
statement
35
New cards
what are the grammar rules for a programming language
syntax
36
New cards
write code to print to screen using both print line and regular print methods:

Hello
World
System.out.println("Hello");
System.out.print("World");
37
New cards
T/F the name of the file should be the same as the name of the class
true
38
New cards
an ___ combines a text editor with commands for compiling and running programs
IDE
39
New cards
write the code to run... the class will have these words/code somewhere in the file
public static void main (String[] args)
40
New cards
java is what type of language
object-oriented
41
New cards
in object-oriented programming ____ perform ____
objects, actions
42
New cards
on object-oriented programming, objects are called
objects
43
New cards
on object-oriented programming, actions are called
methods
44
New cards
objects of the same kind have the same ____ and belong to the same ____
type, class
45
New cards
____ is often called information hiding
encapsulation
46
New cards
____ means "many forms" and occurs when we have many classes that are related by inheritance
polymorphism
47
New cards
in ____ classes at lower levels inherit characteristics of classes above in the hierarchy
inheritance
48
New cards
relating to inheritance...are higher classes more inclusive or less inclusive than lower classes
more inclusive
49
New cards
an ____ is a set of instructions for solving a problem
algorithm
50
New cards
we do two things to eliminate errors by avoiding them in the first place...what are they
testing and debugging
51
New cards
what is an error in program called
bug
52
New cards
what is the term for eliminating errors
debugging
53
New cards
what are the three types of errors
syntax, runtime, logic
54
New cards
the data stored by a variable is called its ____
value
55
New cards
a variable's ____ determines what kinds of values it holds
type
56
New cards
what is the creation of a new variable called
initialization
57
New cards
what sign is used for assigning values to a variable
=
58
New cards
T/F the first character of a variable name must be lower case letter
true
59
New cards
what are words such as int, public, class called
reserved words
60
New cards
Class types begins with an uppercase or lowercase letter
uppercase
61
New cards
String is an example of what
class type
62
New cards
what are the four integer primitive types
byte, short, int, long
63
New cards
what are the two floating-point primitive types
float, double
64
New cards
what is the character primitive type
char
65
New cards
what is the true/false primitive type
boolean
66
New cards
____ price = 10.52
double
67
New cards
____ status = true
boolean
68
New cards
____ letter = 'a'
char
69
New cards
T/F you can declare a variable without assigning it a value
true
70
New cards
T/F you can write variables of different data types in the same line when declaring them
false
71
New cards
T/F you create multiple scanners (declare them)
false
72
New cards
write code for declaring scanner in java
Scanner keyboard = new Scanner(System.in);
73
New cards
T/F you can go from narrow range to wide range regarding variable types
false
74
New cards
what operator is used on string concatenation
+
75
New cards
T/F using \ before a special character will print out the special character
true
76
New cards
in programming java, the index starts at what number
0
77
New cards
arrange in order from narrow to wide:
byte
double
float
int
long
short
byte, short, int, long, float, double
78
New cards
can you assign a variable of type char to a variable of type int using ASCII
yes
79
New cards
what is the value of n

String greeting = "Hello";
int n = greeting.length();
5
80
New cards
what is the code to get the last index of the phrase below:

String string = "Hello";
string.length()-1;
81
New cards
____ ____ ____ is the order in which a program performs actions
flow of control
82
New cards
a ____ statement chooses between two or more possible actions
branching
83
New cards
a ____ statement repeats an action until a stopping condition occurs
loop
84
New cards
what are the three logical operators in java usually used for boolean/conditionals
&&, ||, !
85
New cards
which operator has a higher priority && or ||
&&
86
New cards
____ ____ is similar to alphabetical order but is based on characters in ACII
lexicographic order
87
New cards
what is the type of output of this code:

String string1 = hello;
String string2 = Hello;
System.out.println(string1.compareTo(string2));
positive number
88
New cards
what two things does the .compareTo() method take into account
lexicographic order and length
89
New cards
write the code for the exit method
System.exit(0);
90
New cards
what type of output does the .equals() method return
boolean
91
New cards
the ____ statement is a multiway branch that makes decisions based on an integer or character
switch
92
New cards
what is the output if the user enters 3 into the program below:

import java.util.Scanner;
public class MultipleBirths
{
public static void main (String [] args)
{
int numberOfBabies;
System.out.print ("Enter number of babies: ");
Scanner keyboard = new Scanner (System.in);
numberOfBabies = keyboard.nextInt ();
switch (numberOfBabies)
{
case1:
System.out.println("Congratulations.");
break;
case 2:
System.out.println ("Wow. Twins.");
break;
case 3:
System.out.println ("Wow. Triplets.");
break;
case 4:
case 5:
System.out.print ("Unbelieveable; ");
System.out.println (numberOfBabies + " babies.");
break;
default:
System.out.println ("I don't believe you.");
break;
}
}
}
Wow. Triplets.
93
New cards
what is a loop that repeats without ever ending called
infinite loop
94
New cards
which type of loop do you use when you know the number of recursions...for or while
for
95
New cards
an ____ statement is to trace variables, and if it is true, the program will run after the statement
assertion
96
New cards
an ____ is a special kind of object and is a collection of data
array
97
New cards
can an array collect different types of data
no
98
New cards
T/F you can initialize an array both ways:

int [] array = new int [5];
int array [] = new int [5];
true
99
New cards
if you want to change the size of an array what do you do
create a new array
100
New cards
if you print out an empty element from an array of strings, what value will print
null