chapter-1-theory-lecture-notes
chapter-1-theory-lecture-notes
2/17/2023
Topics
• 1.1 Introduction
• 1.2 Hardware and Software
• 1.3 How Computers Store Data
• 1.4 How a Program Works
• 1.5 Graphical User Interfaces
• 1.6 Objects
• 1.7 The Program Development Process
• 1.8 Getting Started with the Visual Studio Environment
1
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
What is a program?
1.1 Introduction
• A program is a set of instructions that a
computer follows to perform a task
– Programs are commonly referred to as software
– Without software, computers cannot do anything
• Programmers, or software developers, create
software
– They are people with the training and skills necessary
to design, create, and test programs
2
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
3
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
The CPU
The CPU
• The central processing unit is the part that
actually runs programs
– The most important part of a computer
– Today CPUs are microprocessor
– Commonly used CPU vendors are Intel and
AMD
4
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Main Memory
Main Memory
• The computer’s work area
• Where the computer loads instructions of
programs and data for processing
• Commonly known as RAM, random-access
memory
– Designed for CPUs to quickly access data stored at
any random location in the RAM
• They are a volatile type of memory
– When the computer is powered off, the contents in
RAM are erased
Copyright © 2017 Pearson Education, Ltd.
5
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
6
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Input Devices
Input Devices
• Input is any data the computer collects
from people and devices
• Devices that collect the data and send
them to the computer are called input
devices
• Commonly used input devices are touch
screens, keyboards, mouses, scanners,
microphones, and digital cameras
7
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Output Devices
Output Devices
• Output is any data the computer produces
for people or devices
• The device that generates output for a
computer is called an output device
• Commonly used output devices are
screens, speakers, and printers
8
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Software
9
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Software
• Categorized mainly into system software and
application software
– System software are programs that control and
manage the basic operations of a computer.
Subcategories are:
• Operating systems
• Utility programs
• Software development tools
– Application software are programs that perform
special tasks
10
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
11
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
12
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
13
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Programming Languages
Programming Languages
– Machine languages: sequences of 0s and 1s
– Assembly languages: use short words known
as “mnemonics” to write program
• Must be translated by assembler
• Still considered low-level languages
• add, mul, mov
– High-level languages: more human readable
languages that allow programmers to create
programs without knowing how CPU works.
• Modern languages are high-level
Copyright © 2017 Pearson Education, Ltd.
14
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
15
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
16
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
17
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
18
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
19
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Objects
1.6 Objects
• Most programming languages use object-oriented
programming in which a program component is called an
“object”
• Program objects have properties (or fields) and methods
– Properties – data stored in an object
– Methods – the operations an object can perform
20
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Controls
Controls
• Objects that are visible in a program GUI are
known as controls
– Commonly used controls are Labels, Buttons, and
TextBoxes
– They enhance the functionality of your programs
• There are invisible objects in a GUI such as
Timers, and OpenFileDialog
21
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
22
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
23
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
24
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Pseudocode example
If student's grade is greater than or equal to
60
Print "passed"
else
Print "failed"
Flowchart example
25
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
The Designer
26
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Solution Explorer
Properties Window
27
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
28
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
The Toolbox
• Toolbox is a window for selecting controls to use in an
application
– Typically appears on the left side of Visual Studio environment
– Usually in Auto Hide mode
Toolbox tab
The Toolbox
• Toolbox is a window for selecting controls to use in an
application
– Divided into sections such as “All Windows Forms” and
“Common Controls”
29
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
Tooltips
• A Tooltip is a small box that pops up when you hover the
mouse pointer over an item on the toolbar or toolbox.
Tooltip
30
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
31
Downloaded by Silindokuhle Boyi ([email protected])
lOMoARcPSD|33430560
2/17/2023
32
Downloaded by Silindokuhle Boyi ([email protected])