Module 1 and 2 CE Computer Fundamentals Programming
Module 1 and 2 CE Computer Fundamentals Programming
Computer Fundamentals
Programming
2nd Semester, SY 2018-2019
• Definition of Programming
• Purpose of Making Programs
• Programming Language
• Types of Programming Language
• Generations of Programming Language
• Examples of Programming Language
• Compiler
• Interpreter
• Choosing a programming Language
• How to make programs
Continuation…
4
• Flowchart
• Algorithm
• The C# programming Language
• What is C#?
• C# Operators
- (Mathematical, Assignment, Relational, Boolean)
• Looping
- (While, Do, For)
• Arrays
- (Single, Multi-dimensional Arrays)
• Textfiles
Course Requirements
5
• Quizzes
• Attendance
• Recitation
• Seatwork
• Written/Laboratory Midterm and Final
Examinations
• Laboratory Exercises
• Create a simple system using C# Programming
Language (Final Project)
Grading System:
Midterm & Final Exam – 50% Grade – 100%
Other components – 50%
6
Module 1: Introduction to
Computer Programming
What is a Program?
7
• Generic
• General
• does not necessarily always mean "program" or
"application" (e.g. a software "library" or "framework" is
not a "program" or "application", but are used to
facilitate the functional requirements of "programs" or
"applications").
Without programs, computers are useless!
Computer software, or simply
software, is a collection of data
or computer instructions that tell
the computer how to work. This
is in contrast to physical
hardware, from which the system
is built and actually performs the
work. Wikipedia
Why do programmers make computer
programs?
11
• To simplify task
• Web languages
• Software languages
• The different generations of languages
• Procedure oriented programming
• Object oriented programming
Types of Programming Language
17
Web Languages
• HTML
• XML
• JAVASCRIPT
• VBSCRIPT
• PHP
• ASP
• JAVA
Types of Programming Language
18
Software Languages
• C
• C++
• Visual Basic
• JAVA
• C#
Types of Programming Language
19
End of Module 1
Note: prepare for a quiz next meeting
29
30
n
31
Computer Fundamentals
Programming
Module 2 - Designing and Creating a
Program
• Cookbook
• Recipe Booklet
• Choreography
Example
of
Flowchart
Notations Used in Flowchart
46
Notation Meaning
: comparison
& logical and
Y yes
N no
EOF End of File
Relational Test Operators
47
Notation Meaning
> is greater than
< is less than
<= or =< is less than or equal to
>= or => is greater than or equal to
<> or >< is not equal to
= is equal to
Arithmetic Operators
48
Notations Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
() Grouping
** or ^ Exponentiation
Precedence of the Operators
49
1. Grouping ()
2. Exponentiation
3. Multiplication or division
4. Addition or subtraction
When operators are all of equal priority, the
computer evaluate the expression from left
to right.
50
When operators are of different priorities, the
computer performs those operations with higher
priorities first
51
Operations enclosed in parentheses will take place
before other operations. Note (if there are multiple
parentheses, the innermost parenthesis will be
52
evaluated first).
Write clearly the computation desired
53
Example #2.3
2L / 3G
Answer?
( 2 * L ) / (3 * G )
Problem 6 and 7
54
59
Problem 9 and 10
60
Age Charge
<16 7
>=16 and <65 10
>=65 5
Problem 12 and 13
62
End of Module 2
Note: prepare for a quiz next meeting; Submit all answer to Problems
provided, use the worksheet template provided.
65
Computer Fundamentals
Programming
Module 3 – The C# Programming
Language
• Namespace declaration
• A class
• Class methods
• Class attributes
• A Main method
• Statements & Expressions
• Comments
The C# Code
69
using System;
class HelloWorld
{
static void Main(string[]
args)
{
/* my first program in C#
*/
Console.WriteLine("Hello
World");
Console.ReadKey();
}
}
Line #1: using System;
70
72
/*
This program demonstrates
The basic syntax of C# programming
Language
*/
74
WriteLine is a
method of the
Console class
defined in the
System
namespace. This
statement causes
the message
"Hello, World!" to
be displayed on
the screen.
Line #8: Console.ReadKey();
75
• C# is case sensitive.
• Namespace declaration
• A class
• Class methods
• Class attributes
• A Main method
• Statements & Expressions
• Comments