Lecture 1 Flashcards
(23 cards)
What is the size of a byte?
8 bits
How many bytes are in a kilobyte (KB)?
1024 bytes
How many bytes are in a megabyte (MB)?
1,048,576 bytes
How many bytes are in a gigabyte (GB)?
1,073,741,824 bytes
What is the typical range of main memory in a computer?
4 GB to 32 GB
What happens when a program is started?
It is brought into memory for the CPU to read
How does the CPU run a program?
One instruction at a time
What is software typically realized as?
An application program
Name three examples of software.
- Microsoft Word
- Computer Games
- Operating systems
What is programming?
The act of designing and implementing computer programs
What is an algorithm?
A sequence of actions to accomplish a given task
How is an algorithm similar to a recipe?
It is a set of instructions written in a sequence that achieves a goal
What are the three characteristics of a well-defined algorithm?
- Unambiguous
- Executable
- Terminating
What does it mean for an algorithm to be unambiguous?
No assumptions are required; uses precise instructions
What does it mean for an algorithm to be executable?
The algorithm can be carried out in practice
What does it mean for an algorithm to be terminating?
The algorithm will eventually come to an end
What is a simple example of an algorithm?
Getting a drink of orange juice
List the steps in the simple algorithm for getting orange juice.
- Get a glass from your cabinet
- Go to the refrigerator and get the orange juice container
- Open the orange juice container
- Pour the orange juice into the glass
- Put the orange juice container back in the refrigerator
- Drink your juice
What factors need to be considered when selecting a car?
- Purchase price
- Fuel Efficiency (mpg)
- Price per gallon
- Annual miles driven
- Length of time
What is the first step in developing an algorithm for selecting a car?
Determine the inputs and outputs
How is annual fuel cost calculated?
Price per gallon * Annual fuel consumed
What is the formula for calculating total cost for each car?
Total cost = Purchase price + Operating cost
Fill in the blank: An algorithm is like a _______.
[recipe]