Programming Midterm Exam Questions
& Answers 2023/2024
intelligence - ANSWER-behavior driven by reasoning
reasoning - ANSWER-producing new truths based on existing (old) truths
logic - ANSWER-structured reasoning
structure - ANSWER-some set of symbols and a way to combine them in certain ways (grammar)
Programming - ANSWER-general: writing the instructions for the computer to preform; connecting your
imagination to the real world, you want it to be intelligent and rational/to react, its reasoning with
symbols (tiny amounts of electricity/semiconductors = symbols for computer)
taking imagination and forming logic (with logic operations--and/or/not) w/ hopes that it relates to the
real world
the manipulation of symbols
Turing-Complete Language (TCL) - ANSWER-3 elements:
1) State (memory)
2) Functions (abstraction over state)
3) Input and Output (put information into the computer and get it out)
State - ANSWER-one of the fundamental elements of TCLs: state is memory-- allow us to store and
retrieve information
, state is a serial operation; there is an order and to retrieve it, it must be stored earlier
state requires names as a way to identify memory (assignment statements)
Choice - ANSWER-conditionally executed code, an operation is carried out only when some condition is
true
Boolean expression (BE) - ANSWER-something that is either True or False; how we determine choice
True = "true" or any non-zero number or non-empty string
False= "False" or zero or an empty string
uses and/or/not (logical operators)
Completeness vs Soundness - ANSWER-Completeness: if its true on the left, then its true on the right--
your program will produce the same symbolic truth
Soundness: if its true on the right, its true on the left--symbolic truth corresponds to reality
Computer Architecture - ANSWER-the heart of the computer is the CPU (the central processor unit), bus,
and memory
Bus - ANSWER-Kind of electric highway between CPU and memory--two types: address bus (where it is)
and data bus (what it contains)
Central Processing Unit (CPU) - ANSWER-two components: the arithmetic/logic unit (ALU) and the
control unit (CU); the control unit gets the contents from memory (instructions) and sends information
from memory to ALU where the ALU executes some operation and stores the result (called the fetch-
execute cycle)