MU Structured Programming Fall 2024 CH01 Introduction
MU Structured Programming Fall 2024 CH01 Introduction
Structured Programming
Introduction
2
Computer System Components
3
Computer System Components
User
Application Programs
Operating System
Computer Hardware
4
Computer System Components
Hardware
• Provides the basic computing resources for the system.
• E.g., the central processing unit (CPU), the memory, and the input/output (I/O) devices.
Application programs
• Define the ways in which these resources are used to solve users' computing problems.
• E.g., word processors, spreadsheets, compilers, and Web browsers
Operating system
• Controls the hardware and coordinates its use among the various application programs for the various users.
• E.g., Microsoft Windows, Apple iOS, Google Android.
Users
• Commonly humans but can be machines as well.
5
Computer System Organization
6
Computer System Organization
Computer
Input Devices
Output Devices
7
Computer Examples
8
Computer Software
9
Computer Software
10
Computer Instructions
12
Programming Language
13
Interpreter
Interpreter Interpreter
14
Compiler
Source
Program
Code
Program
Compiler
15
Programming Language Levels
• Example: • Example:
x = a + b LOAD r1, a
LOAD r2, b
ADD r1, r2
STORE x, r1
16
Programming Language Types
Programming
Languages
Structured Unstructured
Programming Programming
Languages Languages
17
Unstructured Programming
18
Unstructured Programming
19
Unstructured Programming
20
Structured Programming
21
Structured Programming
22
Structured Programming
Program
23
Structured vs. Unstructured Programming
24
Readability
Structured Programming
Unstructured Programming
Structured Programming
Unstructured Programming
26
Complexity
Structured Programming
Unstructured Programming
Structured Programming
Unstructured Programming
28
Modifications
Structured Programming
• It is easy to do changes.
Unstructured Programming
• It is hard to do modifications.
29
Data Types
Structured Programming
Unstructured Programming
Structured Programming
Unstructured Programming
Structured Programming
Unstructured Programming
33
Algorithms
34
Problem Solving
Inputs
• A phone book that is sorted alphabetically.
• A name to look for in the sorted phone book.
Output
• The phone number associated with the name.
• Or “Not found” if the name does not exist in the phone book.
35
Problem Solving
36
Problem Solving
37
Pseudocode
• Example:
38
Flowchart
39
Flowchart Definition
40
Uses of a Flowchart
41
Flowchart Symbols
42
Terminator
43
Process
44
Decision
45
Input / Output
46
Arrow
Start Stop
47
Flowchart Examples
48
Printing “Hello World” to the Screen
Start
Stop
49
Adding Two Numbers
50
Print Grade Based on Score
yes No
score ≥ 50?
51
Print Numbers from 1 to 1000
Start x=1
yes No
x ≤ 1000?
52
Development Environment
53
What is Visual Studio?
54
Required Software to Develop using C#
C#
Program
Code
Program
55
Installing Visual Studio
56
Visual Studio Installation Steps
• Go to https://visualstudio.microsoft.com/
• Select Visual Studio or Visual Studio for mac.
• Select the free community edition and download the file.
• Run the downloaded file to install the visual studio installer.
• Run the visual studio installer and select the modules to install.
• For Desktop apps, select the .NET Desktop Development module.
57
C# on Your Smartphone
Android iOS
58
Thank You
59