Java Games: Flashcards, matching, concentration, and word search.

COMP 110 Quiz 1

AB
HardwareThe physical machine. Circuits that execute, store, and interact with instructions. Execution: CPU. Storage: Memory. Interaction: Peripherals, like keyboards and monitors
SofwareAll the different programs used collectively to give instructions to the computer are software. Ex. Windows 7, Google Chrome, Microsoft Word
ProgramThe set of instructions for a computer to carry out, also known as software. Our programs will be in Java
InstructionsA sequence of 0s and 1s that represents a single operation on the computer.
BitsThe individual 0s and 1s are referred to as bits.
Why only use 0s and 1s?Its easier to make an electrical device that has only 2 stable states
ByteA byte is the smallest addressable unit of memory contains 8 bits (0s or 1s).
What's the Central Processing Unit (CPU)?The "brain" of the computer. It executes instructions (reads data from memory, does calculation, writes calculation results back to memory). CPU sees everything as memory.
MemoryHolds data for the computer (how much CPU can remember)
Main memory isHolds current program and the data it's manipulating. It disappears when you shut your comp down.Ordered sequence of cells , directly connected to the CPU (aka. Random Access Memory, RAM). All programs must be brought into main memory before execution.
Secondary memory isHard drives, CDs, flash drives. It exists until you delete it, retaining info even if power is off
1 Kilobyte (KB)1,000 bytes
1 Megabyte (MB)1 million bytes (1,000 KB)
1 Gigabyte (GB)1 billion bytes (1,000 MB)
1 Terabyte (TB)1,000,000,000,000 bytes (1,000 GB)
Main memory, memory addressUsed to locate certain memory positions, CPU fetches data according to memory address.
Peripherals (input devices)Keyboard, mouse, etc. When they get input they save that at certain memory addresses
Peripherals (output devices)Monitor, speaker, printer. They're projected to a certain memory address. When CPU wants to output, it writes those addresses.
High-level programming languagesDesigned to be relatively easy for people to understand and use. Java is high level.
Why do we use Java?It's widely used, incorporates (most ) modern features
Machine languageMachine language is the most basic language of a computer. A sequence of 0s and 1s (bits). Every computer directly understands its own machine language.
CompilerThe translation of a high-level language program to a low-level language is often done by a program called a compiler. So it takes something from human-readable to machine-readable
Programming languages: JavaGeneral purpose. Best for writing larger programs.
Programming languages: JavascriptNo relation to Java! Very specialized. Run in your web browser and adds advanced behavior to web pages
Programming languages: PythonGeneral purpose but a scripting lang. Much easier to write small programs, but not bigger ones
Programming languages: MatlabVery different from other 3 languages. Very powerful/specialized. Good for solving equations, graphing data etc
Program Counter (PC)Points to the next instruction to be executed
Instruction Register (IR)Holds the currently executing instruction
Arithmetic Logic Unit (ALU)Carries out all arithmetic and logical ops
Accumulator (ACC)Holds the results of the operations performed by the ALU
Main memory with 100 cellsEach memory cell has a numeric address which uniquely identifies it
How is info moved from main memory to secondary memory?As needed
Example of CPU running program: Opening NotepadUse mouse to select Notepad. CPU requests Notepad application. Notepad is loaded from the hard drive to main memory. CPU reads instructions from MM and executes one at a time. Notepad is displayed on your monitor.
Operating System (OS)Monitors overall activity of the computer and provides services. Written using programming language. Example services: memory management, input/output, storage management
Application ProgramsWritten using prog languages. Perform a specific task, run by the OS. Examples: Browsers, word processors, spreadsheets, games
Classify the following as operating system or application: Microsoft Windows 8OS
Classify the following as operating system or application: Microsoft PowerPointApplication
Classify the following as operating system or application: LinuxOS
Classify the following as operating system or application: Your COMP 110 programsApplication
All about data (software/hardware)Software is data (#s, characters, instructions, programs). Hardware stores and precesses data (read, write, add/subtract/multiply)
Digitizing informationAll info in a computer is digitized (broken down and represented as numbers)
Why can’t windows programs run on Apple computers?Because the machine language is specific and different, so it cant be applied to a different program.
Bit permutationsEach permutation can represent a particular item. There are 2N permutations of N bits (N bits are needed to represent 2N unique items)
How many items can be represented by 2 bits?2^N = 2^2 = 4 items
Syntax rulesWhich statements are legal and which are not
Semantic rulesdetermine the meaning of the instructions
TokenSmallest individual unit of a program. Has special symbols, word symbols, and identifiers
Word symbols (aka reserved words or keywords)Always lowercase. Each word symbol is considered a single symbol. Cannot be used for anything other than their intended purpose in a program
IdentifiersNames of things in your program (variables, constants, etc). Can be made of any combo of letters, digits, underscore and dollar sign. Can't begin with a digit, and can't have any spaces. May be any length. Java is CASE SENSITIVE!!!
4 primitive data types in Java that represent integersByte, short, int, long
2 primitive data types in Java that represent floating point numbersFloat, double
1 primitive data type in Java that represents charactersChar
1 primitive data type in Java that represents boolean valuesBoolean
What are primitive data typesFundamental values like numbers and characters. Data types are sets of values and the operations that can be performed on those values.
IntegersEx. -6778, -67, 0, 1203. Positive integers don't have + sign in front of them (but they can). No commas are used in an integer



This activity was created by a Quia Web subscriber.
Learn more about Quia
Create your own activities