Introduction To Programming

Slides:



Advertisements
Similar presentations
Lecture Computer Science I - Martin Hardwick Strings #include using namespace std; int main () { string word; cout
Advertisements

Computer Science 1620 Loops.
1 Lecture 11:Control Structures II (Repetition) (cont.) Introduction to Computer Science Spring 2006.
Your First C++ Program Aug 27, /27/08 CS 150 Introduction to Computer Science I C++  Based on the C programming language  One of today’s most.
1 10/20/08CS150 Introduction to Computer Science 1 do/while and Nested Loops Section 5.5 & 5.11.
1 10/11/06CS150 Introduction to Computer Science 1 do/while and Nested Loops.
Iteration This week we will learn how to use iteration in C++ Iteration is the repetition of a statement or block of statements in a program. C++ has three.
COMP102 – Programming Fundamentals I LA2B (Mon 5-7pm) LA2E (Fri 3-5pm) LA2F (Fri 5-7pm) TA: Jackie Lo.
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
Loops Programming. COMP104 Lecture 9 / Slide 2 Shortcut Assignment l C++ has a set of operators for applying an operation to a variable and then storing.
Computer Science 1620 Lifetime & Scope. Variable Lifetime a variable's lifetime is finite Variable creation: memory is allocated to the variable occurs.
CS31: Introduction to Computer Science I Discussion 1A 4/9/2010 Sungwon Yang
Mr. Dave Clausen1 La Cañada High School Chapter 6: Repetition Statements.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 4 Loops.
Chapter 4 Loops Write code that prints out the numbers Very often, we want to repeat a (group of) statement(s). In C++, we have 3 major ways of.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 7 Clicker Questions September 22, 2009.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
COMPUTER PROGRAMMING. Iteration structures (loops) There may be a situation when you need to execute a block of code several number of times. In general,
Program Flow Control - Looping Addis Ababa Institute of Technology Yared Semu April 2012.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
1 8/31/05CS150 Introduction to Computer Science 1 Hello World!
REPETITION STATEMENTS - Part1  Also called LOOP STATEMENTS OR LOOP STRUCTURES 1 C++ Statements that repeat one or more actions while some condition is.
Chapter 7: Repetition Structure (Loop) Department of Computer Science Foundation Year Program Umm Alqura University, Makkah Computer Programming Skills.
1 8/30/06CS150 Introduction to Computer Science 1 Your First C++ Program.
LOOPS IN ‘C’ PROGRAMMING. V ERY O FTEN, Y OU W ILL W ANT TO D O S OMETHING M ORE T HAN O NCE HA.
Loop Control อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 8.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
LESSON 5 Loop Control Structure. Loop Control Structure  Operation made over and over again.  Iterate statement.
Computer Programming -1-
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
CHAPTER 4 REPETITION STRUCTURES 1 st Semester King Saud University College of Applied studies and Community Service CSC1101 By: Asma Alosaimi.
Introduction to Computer Programming
CHAPTER 4 REPETITION CONTROL STRUCTURE / LOOPING
Introduction to C++ Programming Language
C++ Programming: CS150 For.
for Repetition Structures
Intro to Programming Week # 6 Repetition Structure Lecture # 10
Control Statements Kingdom of Saudi Arabia
Programming Fundamentals
Chapter 4 Loops Case Studies
Chapter 4 Repetition Structures
Introduction to Functions
For Loops October 12, 2017.
Chapter 4 Repetition Structures
Loop Control Structure.
Loops October 10, 2017.
For & do/while Loops.
Random Number Generation
CS150 Introduction to Computer Science 1
Loops in C.
Repetition Control Structure
Chapter 6: Repetition Statements
Introduction To Programming
Control Structures Part 1
Let’s all Repeat Together
Introduction To Programming
Introduction To Programming
Salam & Hello! I am Muhammad Meer Hazaar Khan
Introduction To Programming
Introduction To Programming
Salam & Hello! I am Muhammad Meer Hazaar Khan
do/while Selection Structure
CS150 Introduction to Computer Science 1
Reading from and Writing to Files
Repetition Statements (Loops) - 2
PROGRAM FLOWCHART Iteration Statements.
Salam & Hello! I am Muhammad Meer Hazaar Khan
system and network administration
Reading from and Writing to Files
Presentation transcript:

Introduction To Programming :Author: Muhammad Meer Hazaar Khan Introduction To Programming

Salam & Hello! I am Muhammad Meer Hazaar Khan Alhamdolilah A licensed professional engineer a schooled and skilled in the application of engineering discipline to the creation of software and seeking to share my knowledge and experience with students . You can find me at CS Department Government College University Layyah Campus or meerhazaarkhan@yahoo.com

Some Words, Muhammad Meer Hazaar Khan “Freelancing & Enterprenuership“. LinkedIn Profile: https://www.linkedin.com/in/muh ammad-meer-hazaar-khan- 6b11ab96/ Upwork Profile: https://www.upwork.com/freelan cers/~01c0fdce3eda554427 YouTube Channel: https://www.youtube.com/chan nel/UC0Ifqps33SDm5LdYTbEkO1A ?view_as=subscriber “Engineering Degree". B.S.C Software Engineering University And Engineering And Technology Taxila Approved By PEC & Washington Accord U.S.A M.S Degree M.S Computer Science Institute Of Southern Punjab Research Area: Semantic Web Gold Medalist Muhammad Meer Hazaar Khan @ Registered Software Engineer Pakistan Engineering Council No Comp 11516 Lecturer Computer Science Government College University Faisalabad Layyah Campus Freelancer at Upwork Enterprenuer More info on how to find and understand the lectures and the blogs post at Official Website: http://thestackunderflow.com/. .

Seeking knowledge is an obligation upon every Muslim” (Sunan Ibn Majjah, 224)

Let’s start with the first set of slides 1 Basics OF Programming Let’s start with the first set of slides

Text Book Object Oriented Programming in c++ any updated Edition by Robert Lafore

Loops Programming languages provide various control structures that allow for more complicated execution paths. A loop statement allows us to execute a statement or group of statements multiple times and following is the general from of a loop statement in most of the programming languages

For Loop A for loop is a repetition control structure that allows you to efficiently write a loop that needs to execute a specific number of times. Syntax: for ( init; condition; increment ) { statement(s); }

For Loop #include <iostream> using namespace std; int main () { // for loop execution for( int a = 10; a < 20; a = a + 1 ) { cout << "value of a: " << a << endl; } return 0;

While Loop A while loop statement repeatedly executes a target statement as long as a given condition is true. Syntax: while(condition) { statement(s); }

#include <iostream> using namespace std; int main () { // Local variable declaration: int a = 10; // while loop execution while( a < 20 ) { cout << "value of a: " << a << endl; a++; } return 0; Example,

Do While Loop Unlike for and while loops, which test the loop condition at the top of the loop, the do...while loop checks its condition at the bottom of the loop. A do...while loop is similar to a while loop, except that a do...while loop is guaranteed to execute at least one time. Syntax do { statement(s); } while( condition );

#include <iostream> using namespace std; int main () { // Local variable declaration: int a = 10; // do loop execution do { cout << "value of a: " << a << endl; a = a + 1; } while( a < 20 ); return 0; } Example,

Nested Loop A loop can be nested inside of another loop. C++ allows at least 256 levels of nesting.