Final exams Pt 1 Flashcards
List the major components of a computer
- Central Processing Unit (CPU)
- Graphics Processing Unit/Video Card
- Random Access Memory (RAM)
- Read Only Memory (ROM)
- Secondary Memory (HDD, SSD)
- Motherboard
- Peripherals
List 3 things a CPU does
- Perform Logical Operations
- Process Data
- Store Data
Give the functions of: RAM, Secondary Memory, GPU, Peripherals
- RAM: Store data short term while the computer is working with it
- Secondary Memory: Store data long term, while a program is closed or while the computer is turned off
- GPU: Process graphics calculations and create images
- Peripherals: Take input and give output to the user
What are the 5 data types that variables can be? Give a literal example of each.
- int – 5, 10, -5 (whole numbers)
- float – 2.0, 3.6, 0.45 (integers)
- char – ‘a’, ‘@’, ‘P’ (characters)
- String – “Hello!”, “this is a sentence” (words)
- boolean – true, false (true or false)
What are the requirements for a variable identifier?
Must start with a letter, can only contain letters, numbers, and the underscore ( )
Variable declaration statement:
A variable to hold the number of birds spotted in a day
int birds;
Variable declaration statement:
A variable for someone’s overall average mark at school
float mark;
Variable declaration statement:
A variable for the vertical position of a circle on the screen
1) int y;
2) float y;
Variable declaration statement:
A variable to hold someone’s name
String name;
Variable declaration statement:
A variable to indicate if an event needs to start
boolean go;
Variable declaration statement:
A variable to hold a key on the keyboard
char letter;
Variable initialization statement:
A variable to hold the sum of a bunch of numbers.
int sum = 0;
Variable initialization statement:
A variable which will be used to calculate the product of set of numbers
float product = 1; or int product = 1;
A variable that will hold the name of a character.
String name = “your name”;