Lecture 1
Lecture 1
COMPUTER PROGRAMMING
Declaration of variables
Assignment
Operators
COURSE DESIGN
۞ Course Code: GL/MN-351
۞Credits: (2,1,2)
۞Prerequisites: Computer Programming
۞References
◦Title: C# Programming From Problem Analysis to
Program Design, 5th Edition or 3rd Edition.
◦Author: Barbara Doyle
◦Publisher: Cengage, 1088 pp, 2016 or 832pp, 2010
COURSE OUTLINE
۞Elements of programming.
۞Data description statements.
۞Control structures.
۞Data types.
۞Data-processing statements.
۞Input and output (I/O) statements.
COURSE OUTLINE
۞Procedure for writing algorithms
۞Building application.
۞Steps in developing application.
۞Decisions.
۞Conditions and loops.
۞Arithmetic operators.
۞Programming applications in Engineering.
EVALUATION METHODS
۞Assignments
۞Labs
۞Quizzes
۞Final Exam
INTRODUCTION
۞A "programming language" is a medium
designed to allow humans to give instructions or
describe consecutive actions to be executed by a
computer.
۞The language used by the processor is called
machine code.
۞The code that reaches the processor consists
of a series of 0s and 1s known as binary data.
INTRODUCTION
۞Machine code is therefore difficult for humans
to understand
۞Hence, the need for intermediary languages,
which can be understood by humans.
۞The code written in this type of language is
translated into machine code using compilers and
interpreter for the computer to process.
INTRODUCTION
There are several basis for classifying programming
languages:
۞Based on Levels of Abstraction
۞Based on How codes are Translated to
Machine Code
۞Based on Programming Paradigm.
INTRODUCTION
Classification Based on:
Based on Levels of Abstractions
۞Low Level Languages
۞High Level Languages
CATEGORIES
TWO CLASSES OF PROGRAMMING
LANGUAGES:
Low Level Languages High Level Languages
System object
C++ Compiled
programming
TRANSLATION
COMPILED, INTERPRETED, OR INTERMEDIARY
LANGUAGE?
Language Main application area Compiled/interpreted
Internet oriented
Java Intermediary
programming
MyInt = 5;
int MyInt = 5;
C# - Operators
An operator is a symbol that tells the compiler to
perform specific mathematical or logical manipulations.
C# has rich set of built-in operators and provides the
following type of operators:
➢Arithmetic Operators
➢Relational Operators
➢Logical Operators
➢Assignment Operators
Arithmetic Operations
Arithmetic Operations
۞Following table shows all the arithmetic operators supported by C#. Assume
variable A holds 10 and variable B holds 20 then An operator is a symbol that tells
the compiler to perform specific mathematical or logical manipulations.
Arithmetic Operations
Mathematical Functions: The common mathematical
functions in C# include:
Basic Arithmetic Operations