Week 1 Lecture 1 LAB Weka lecture for machine learning
1. PROGRAMMING FUNDAMENTALS
BS SE/CS – 1st Semester
Credit Hours : 3-1
1
Department of Computer Science/IT
Sarhad University of Science and Information Technology, Peshawar
2. CS 116- PROGRAMMING FUNDAMENTALS
WEEK: 01
LECTURE: 01- LAB
LEVEL: BS SE/BS CS- 1ST SEMESTER
2
COURSE INSTRUCTOR: ADAM KHAN (adam.me@suit.edu.pk)
ACCESSED AT : portal.suit.edu.pk
Department of Computer Science/IT
Sarhad University of Science and Information Technology, Peshawar
3. Text Books:
1. Object-Oriented Programming using C++ by Tasleem Mustafa
2. The C Programming Language, 2nd Edition by Brian W.
Kernighan, Dennis M. Ritchie
Reference Books:
3. C How to Program, 7th Edition by Paul Deitel & Harvey Deitel
4. Problem Solving and Program Design in C++, 7th Edition by
Jeri R. Hanly & Elliot B. Koffman
5. Object-Oriented Programming in C++, 3rd Edition by Robert
Lafore
6. Computer Programming in C/C++ by Muhammad Tariq
Siddiqi, 2006.
7. Let us C++ by Yashavant Kanetkar
Recommended Books
3
Department of Computer Science/IT
Sarhad University of Science and Information Technology, Peshawar
4. Lecture Outlines
4
• Problem Solving Techniques
• Steps
• Solving Skills
• Problem solving approaches
• Problem solving steps in Programming
• Advantages
• Disadvantages
Department of Computer Science/IT
Sarhad University of Science and Information Technology, Peshawar
5. Learning Outcomes
5
Students will learn:
• Simple programs / Execution,
• Problems while run the programs, identify the Data, Inputs,
Process, Output.
Department of Computer Science/IT
Sarhad University of Science and Information Technology, Peshawar
6. PROGRAM TITLE :Write a program To display the name of
ALLAH.
#include<iostream.h>
#include<conio.h>
void main( )
{
cout<< “with the name of ALLAH”<<endl;
getch( );
}
6
Simple Program
7. Function:
In the above Example.
Only one function main ( ) is used.
With empty parenthesis.
Out Put:
Cout identifies actually an object.
Correspond to standered out put stream.
Stream is an abstraction that refers to a flow of data.
‘<<’ is called the Insertion or put to operator.
Preprocessor Directories:
Tell the compiler to insert another file into source file.
7
Simple Program
8. • Structure of a C ++ Program:
• Every C ++ program consists of one or more functions.
• Each function consists of a header and a block.
• Header consists of the function name followed by an optional
list of arguments enclosed in parenthesis.
• Header of main function is as follows—void main()
• Declaration part contains declaration of all the variables
• Both statement part and declaration part are enclosed in a
single pair of braces ({ }).
8
Simple Program
9. Phases of C++ Programs:
1. Edit
2. Preprocess
3. Compile
4. Link
5. Load & Execute
Loader
Primary
Memory
Program is created in
the editor and stored
on disk.
Preprocessor program
processes the code.
Loader puts program
in memory.
CPU takes each
instruction and
executes it, possibly
storing new data
values as the program
executes.
Compiler
Compiler creates
object code and stores
it on disk.
Linker links the object
code with the libraries,
creates a.out and
stores it on disk
Editor
Preprocessor
Linker
CPU
Primary
Memory
.
.
.
.
.
.
.
.
.
.
.
.
Disk
Disk
Disk
Disk
Disk
Phases of C++ Program