Programming Chapter 1

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

1/36

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:53 AM on 6/14/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

37 Terms

1
New cards

Computer

programmable machine designed to follow instructions

2
New cards

Program

Instructions in computer memory to make it do something

3
New cards

Programmer

Person who writes programs to make a computer perform a task

4
New cards

Without programmers _

No programs, a computer cannot do anything

5
New cards

Main Hardware Component Categories

Central Processing Unit

Main Memory

Secondary Memory/Storage

Input Devices

Output Devices

6
New cards

CPU

Comprised of:

Control Unit

  • Retrieves and decodes program instructions

  • Coordinates activities of all other parts of computer

Arithmetic and Logic Unit

  • Hardware optimized for high-speed numeric calculation

  • Hardware designed for true/false, yes/no decisions

7
New cards

Main Memory

Volatile, erased when program terminates or computer is turned off

Also called Random Access Memory

Organized as:

Bit:smallest piece of memory, has values 0 (off, false) or 1 (on, true)

Byte: 8 consecutive bits. Bytes have addresses.

8
New cards

Addresses

A unique number identifying each byte

9
New cards

Secondary Storage

Non-volatile: data retained when program is not running or computer is turned off

Comes in a variety of media:

  • magnetic: traditional hard drives that use a moveable mechanical arm to read/write

  • solid state: data stored in chips, no moving parts

  • optical: CD-ROM, DVD

  • flash drives: connected to USB port

10
New cards

Input Devices

Devices that send information to the computer from outside

Many devices can provide input:

  • keyboard, mouse, touchscreen, scanner, digital camera, microphone

  • Disk drives, CD drives, and DVD drives

11
New cards

Categories of Software

System software: programs that manage the computer hardware and the programs that run on them ex. OS, utility programs, software development tools

Application software: programs that provide services to the user ex. Word processing, games, programs to solve specific problems

12
New cards

Algorithm

A set of well-defined steps

13
New cards

True or false: The computer only executes machine language instructions

True

14
New cards

Machine Language

Instructions as binary numbers

15
New cards

True or false: Programmers write programs in machine language

False, programmers use programming languages

16
New cards

Types of programming languages

Low level: Used for communication with computer hardware directly, often written in binary machine code

High level: Closer to human language

17
New cards

List of common programming languages

C

C++

C#

Basic

Fortran

Cobol

Java

JavaScript

Ruby

Visual Basic

Swift

Rust

Go

18
New cards

Steps to turn a high-level program to an executable file

A) create file containing the program with a text editor

B) run preprocessor to convert source file directives to source code program statements

C) run compiler to convert source program into machine instructions

D) Run linker to connect hardware-specific code to machine instructions, producing an executable file

*B-D are often performed by a single command/click

*Errors detected at any step will prevent execution of following steps

19
New cards

Integrated Development Environments (IDEs)

Combines all tools needed to write, compile, and debug a program into a single software application ex. Microsoft Visual C++, Turbo C++ Explorer, CodeWarrior

20
New cards

Common elements in programming languages

  • Key words

  • Programmer-defined identifiers

  • Operators

  • Punctuation

  • Syntax

21
New cards

Key Words

  • Also known as reserved words

  • Have a special meaning in C++

  • Cannot be used for any other purpose

22
New cards

Key Words in Program 1-1

Using, namespace, int, double, return

23
New cards

Programmer-Defined Identifiers

  • Names made up by the programmer

  • Not part of the C++ language

  • Used to represent various things: variables (memory locations), functions, etc.

24
New cards

Programmer-Defined Identifiers in Program 1-1

hours, rate, pay

25
New cards

Operators

  • Used to perform operations on data

  • Many types

    • Arithmetic (+,-,*,/)

    • Assignment (=)

26
New cards

Operators in Program 1-1

«,»,=,*

27
New cards

Punctuation

Characters that mark the end of a statement, or that separate items on a list

28
New cards

Punctuation in Program 1-1

,,;

29
New cards

Syntax

  • The rules of grammar that must be followed when writing a program

  • Controls the use of key words, operators, programmer-defined symbols, and punctuation

30
New cards

Variables

  • A named storage location in the computer’s memory for holding a piece of data

31
New cards

Variables in Program 1

hours (hold the hours worked)

rate (hold the pay rate)

pay (hold the gross pay)

32
New cards

Variable Definitions

*required to create a variable definition

Aka, a variable declaration

  • Specifies the type of data a variable can hold, and the variable name

33
New cards

Statement from Program 1-1 defining variables

double hours, rate, pay;

34
New cards

Three steps that a program typically performs

1) gather input data (from keyboard or files on disk drives)

2) process the input data

3) display the results as output (send it to the screen or write to a file)

35
New cards

The Programming Process

  1. Clearly define what the program is to do

  2. Visualize the program running on the computer

  3. Use design tools such as a hierarchy chart, flowcharts, or pseudocode to create a model of the program

  4. Check the model for logical errors

  5. Type the code, save it, and compile it

  6. Correct any errors found during compilation (repeat 5-6 as needed)

  7. Run the program with test data for input

  8. Correct any errors found while running the program (repeat 5-8 as needed)

  9. Validate the results of the program

36
New cards

Procedural Programming

Focus is on the process

Procedures/functions are written to process data

37
New cards

Object-oriented programming

Focus is on objects, which contain data and the means to manipulate the data

Messages sent to objects to perform operations