SlideShare ist ein Scribd-Unternehmen logo
1 von 46
‱Switch Case and
‱Looping   Statement
   By:Abigail C.Santos
         BM 10203




        http://eglobiotraining.com/
‱Programming
‱Switch Case
  The If – else Statement
   If statement (two alternatives)
  If statement (One-Alternatives)
  How to save and run your statement
  Five Programs that is related on switch case program
  Output

‱Looping Statement
   The while Loop
   The Do
 While Loop
   The For Loop
   The Foreach Loop
   Break and continue statement
   Output


                                                         http://eglobiotraining.com/
http://eglobiotraining.com/
Programming
We first define the word “programming”, it is a computer language
programmers use to develop applications, scripts, or other set of
instructions for a computer to execute.

         programming is instructing a computer to do something for
you with the help of a programming language. The role of a
programming language can be described in two ways:
Technical: It is a means for instructing a Computer to perform Tasks
Conceptual: It is a framework within which we organize our ideas
about things and processes.




                                                    http://eglobiotraining.com/
As an individual, I have learned that programming is a
very broad because it composes many scripts,
applications and can be used to run a program that
has been part of the programming language.

     A programming language should both provide
means to describe primitive data and procedures and
means to combine and abstract those into more
complex ones.




                                        http://eglobiotraining.com/
 The distinction between data and procedures
 is not that clear cut. In many programming
 languages, procedures can be passed as data
 (to be applied to ``real'' data) and
 sometimes processed like ``ordinary'' data.
 Conversely ``ordinary'' data can be turned
 into procedures by an evaluation mechanism.




                                   http://eglobiotraining.com/
   If we know how to write a C expression that is equivalent
    of a question such as “Is resting the value of expression
    to select a course of action. In C, the statement is the
    primary selection control structure

   Me: it’s hard to write c expression. So, I just copy and
    paste it into internet.

   A programming language is an artificial language
    designed to communicate instructions to a machine,
    particularly a computer. Programming languages can be
    used to create programs that control the behavior of a
    machine and/or to express algorithms precisely.



                                            http://eglobiotraining.com/
At first, programming is confusing because you have so much to
understand about codes that will enable to run a program.
Programming has applications and program development, the best
example for this is the Internet browser


        Programming is a creative process done by programmers to
instruct a computer on how to do a task. Programming languages let
you use them in different ways, e.g adding numbers, etc
 or storing
data on disk for later retrieval.




                                                   http://eglobiotraining.com/
You have to consider languages to run or
write your own program, most demanded language
in programming is the DEV C++ (a full-featured
Integrated Development Environment (IDE)).

       C++ is one of the most used programming
languages in the world. Also known as "C with
Classes".

New to programming or thinking about it? It might
surprise you to know that there are many
programmers who program just for fun and it can
lead to a job.


                                       http://eglobiotraining.com/
- A switch, case, select or inspect statement is a type of selection control
mechanism that exists in most imperative programming languages such
as Pascal, Ada, C/C++, C#, Java, and so on. It is also included in several
other types of languages. Its purpose is to allow the value of a variable or
expression to control the flow of program execution via a multiway
branch (or "goto", one of several labels).


  The Main Reason using switch case :
 - To improve clarity, by reducing otherwise repetitive coding, and (if
 the heuristics permit) also offering the potential for faster execution
 through easier compiler optimization in many cases.




                                                        http://eglobiotraining.com/
1. The If – else Statement

  -The if statement allows the programmer to make
   decisions within a program.
   - The general format of an if statement is:
       If (expression)
          statement
   -Where expression represents a relational, equality, or
   logical expression ( conditional expression) .




                                                 http://eglobiotraining.com/
If statement (two alternatives)
 Form:
  If (condition)       Note: if condition evaluates to true, then statement is
      statement;       executed and statement is skipped; otherwise, statement is
  else                 skipped and statement is executed
      statement;

If statement (One-Alternatives)
  Form:
  If (condition)          Note: if condition evaluates to true, then statement is
      statement;          executed and statement is skipped

Format of the if statement
- All if statement examples in this text indent statements. The word else
Is typed without indention on a separate line. The format of the if statement
makes its meaning apparent and is used solely to improve program readability;
The format makes no difference to the computer



                                                          http://eglobiotraining.com/
 There may be a situation when you need to
  execute a block of code several number of
  times. In general statements are executed
  sequentially: The first statement in a function is
  executed first, followed by the second, and so
  on.
 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:




                                         http://eglobiotraining.com/
 1. Open Dev C++
 2. Click File and choose New
 3. Post your Statements
 4. after you post your statement
 5. Save it .choose file and save or
 6. click f9 or you can see it shaped like a square




                                    http://eglobiotraining.com/
http://eglobiotraining.com/
Link:   http://gd.tuwien.ac.at/languages/c/programming-
        bbrown/c_028.htm




The above program uses a switch statement to validate and select upon
the users input choice, simulating a simple menu of choices.


                                               http://eglobiotraining.com/
When it compiles and run, this will be it look .
The C expression that was type it on Dev C++
The words are “enter in two number  24”




                                        http://eglobiotraining.com/
Link:   http://www.morrowland.com/apron/tutorials/cp
        p/cpp_switch_case/index.php




                              Example of Switch
                              Case Statement , you
                              Will see the statement
                              on the link that you see
                               in this slide.




                            http://eglobiotraining.com/
After I compile it and run it, the statement is now like this. As you
Can see after you answer the 1st question the next question appear
And after you finish all the question the box will disappear. It means
finish.



                                                   http://eglobiotraining.com/
Link:
http://www.morrowland.com/apro
n/tutorials/cpp/cpp_if_else/index.
php



         Function and target of
        Programming language :
       A computer programming
    language is a language. used to
   write computer programs, which
    involve a computer performing
              some kind of
     computation or algorithm and
   possibly control external devices
      such as printers , disk drives
          , robots, and so on.




                                       http://eglobiotraining.com/
When the statement was done this will it be look like.
I got this from the URL . The URL was posted on the previous
                             slide



                                       http://eglobiotraining.com/
http://msdn.microsoft.com/en-us/library/66k51h7a(v=vs.80).aspx




Did You Know?
The first programming
languages predate the
modern computer. The
19th century saw the
invention of
"programmable" looms and
 player piano scrolls, both
of which implemented
examples of domain-
specific languages.




                                                 http://eglobiotraining.com/
Did You Know ?
All programming languages have some primitive building blocks for the
description of data and the processes or transformations applied to
them(like the addition of two numbers or the selection of an item from a
collection). These primitives are defined by syntactic and semantic rules
which describe their structure and meaning respectively.


                                                   http://eglobiotraining.com/
Link:   http://www.cfanatic.com/topic4267/
                                        http://eglobiotraining.com/
http://eglobiotraining.com/
http://eglobiotraining.com/
Looping
 Statements
 - Loops execute a block of code a specified number of
  times, or while a specified condition is true.
- in PHP, the following looping statements are used:

     *The while Loop
     * The Do
 While Loop
     * The For Loop
     *The Foreach Loop
     *Break and continue statement

http://www.slideshare.net/ilakkiya/looping-statement
                                                 http://eglobiotraining.com/
While structure is another type of loop statements,
where the condition is checked at first, the iteration
will not stop even if the value changes while executing
statements.

                  Form:
                  While(condition)
                  {
                   code to be executed;
                  }


   http://www.slideshare.net/ilakkiya/looping-statement

                                               http://eglobiotraining.com/
 Dowhile statement is same as the while
 statement , the only difference is that it
 evaluates the expression at the end.

            Form:
            do
               {
                 code to be executed;
                }
                while (condition):

  http://www.slideshare.net/ilakkiya/looping-statement


                                                 http://eglobiotraining.com/
 The for loop is used when you know in advance how
  many times the script should run.
 Be for statement takes three expressions inside its
  parentheses separated by semi-colons. When the for
  loop executes, the following occurs:
 The initializing expression is executed. This expression
  usually initializes one or more loop counter, but the
  syntax allow expression any degree of complexity.
 The condition expression is evaluated. Of the value of
  condition is true, the loop statements execute. If the
  value of condition is false, the for loop terminates.

   http://www.slideshare.net/ilakkiya/looping-statement

                                        http://eglobiotraining.com/
Form:

       for {initialization; condition:
      increment )
           {
            code to be executed
           }




http://www.slideshare.net/ilakkiya/looping-statement


                                           http://eglobiotraining.com/
   For Each structure is a loop structure used for arrays

Form:
foreach(array as value)
{
  code to be executed
}

Foreach (array as key => value)
{
  code to be executed
         http://www.slideshare.net/ilakkiya/looping-statement
}
                                               http://eglobiotraining.com/
 Breakends the execution of the for, for each,
 while, do-while or switch statement.



Form:
* Break ( optional numeric argument)



  http://www.slideshare.net/ilakkiya/looping-statement


                                                http://eglobiotraining.com/
   “Continue” is used to skip the current loop iteration
    and continue with the next iteration of the loop. But
    “Break” is to exit from the whole loop.



    Form:
    * Break ( optional numeric argument)



     http://www.slideshare.net/ilakkiya/looping-statement


                                            http://eglobiotraining.com/
http://www.morrowland.com/apron/tutorials/cpp/cpp_for_loop/index
.php



                                     The for loop




                                            http://eglobiotraining.com/
http://www.morrowland.com/apron/tutorials/cpp/cpp_for_loop/index.p
hp




                                             http://eglobiotraining.com/
http://www.morrowland.com/apron/tutorials/cpp/cpp_do_while_loop
/index.php


                                        Do while loop




                                            http://eglobiotraining.com/
http://eglobiotraining.com/
http://www.exforsys.com/tutorials/c-plus-plus/looping-in-c.html




While loop




                                                  http://eglobiotraining.com/
http://eglobiotraining.com/
http://cprogramminglanguage.net/c-break-continue-statements.aspx




                                            Break and continue




                                                 http://eglobiotraining.com/
http://eglobiotraining.com/
http://www.w3schools.com/php/php_looping_for.asp




                      For each loop




                                         http://eglobiotraining.com/
http://eglobiotraining.com/
 Slideshare
 account :abie santos
 http://www.slideshare.net/abiesantos




                                  http://eglobiotraining.com/
In Partial fulfillment of
        requirements in
  Fundamental of Programming




Submitted to : Prof. Erwin Globio
http://eglobiotraining.com/
Submitted By: Abigail C. Santos




                                    http://eglobiotraining.com/

Weitere Àhnliche Inhalte

Was ist angesagt?

Programming Languages An Intro
Programming Languages An IntroProgramming Languages An Intro
Programming Languages An IntroKimberly De Guzman
 
Go programing language
Go programing languageGo programing language
Go programing languageRamakrishna kapa
 
over all view programming to computer
over all view programming to computer over all view programming to computer
over all view programming to computer muniryaseen
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languagesVarun Garg
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof languagenicky_walters
 
SULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN BASHA
 
Programming Languages
Programming LanguagesProgramming Languages
Programming LanguagesEdward Blurock
 
Theory of programming
Theory of programmingTheory of programming
Theory of programmingtcc_joemarie
 
Programming Language
Programming  LanguageProgramming  Language
Programming LanguageAdeel Hamid
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!olracoatalub
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothBhavsingh Maloth
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1REHAN IJAZ
 
Introduction To Computer Programming
Introduction To Computer ProgrammingIntroduction To Computer Programming
Introduction To Computer ProgrammingHussain Buksh
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2REHAN IJAZ
 

Was ist angesagt? (19)

Survelaine murillo ppt
Survelaine murillo pptSurvelaine murillo ppt
Survelaine murillo ppt
 
Project
ProjectProject
Project
 
Programming Languages An Intro
Programming Languages An IntroProgramming Languages An Intro
Programming Languages An Intro
 
Go programing language
Go programing languageGo programing language
Go programing language
 
over all view programming to computer
over all view programming to computer over all view programming to computer
over all view programming to computer
 
Lect 1. introduction to programming languages
Lect 1. introduction to programming languagesLect 1. introduction to programming languages
Lect 1. introduction to programming languages
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
 
SULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notes
 
Programming Languages
Programming LanguagesProgramming Languages
Programming Languages
 
Theory of programming
Theory of programmingTheory of programming
Theory of programming
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
 
Python
PythonPython
Python
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
 
Web programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh MalothWeb programming UNIT II by Bhavsingh Maloth
Web programming UNIT II by Bhavsingh Maloth
 
Programming Fundamentals lecture 1
Programming Fundamentals lecture 1Programming Fundamentals lecture 1
Programming Fundamentals lecture 1
 
Introduction to programming languages part 1
Introduction to programming languages   part 1Introduction to programming languages   part 1
Introduction to programming languages part 1
 
Introduction To Computer Programming
Introduction To Computer ProgrammingIntroduction To Computer Programming
Introduction To Computer Programming
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Programming Fundamentals lecture 2
Programming Fundamentals lecture 2Programming Fundamentals lecture 2
Programming Fundamentals lecture 2
 

Andere mochten auch

Looping statements in C
Looping statements in CLooping statements in C
Looping statements in CJeya Lakshmi
 
March newsletter final
March newsletter finalMarch newsletter final
March newsletter finalEric Pahon
 
Rusko somebody to love (sigma remix powerpoint
Rusko   somebody to love (sigma remix powerpointRusko   somebody to love (sigma remix powerpoint
Rusko somebody to love (sigma remix powerpointmattcav11
 
Rusko somebody to love (sigma remix powerpoint
Rusko   somebody to love (sigma remix powerpointRusko   somebody to love (sigma remix powerpoint
Rusko somebody to love (sigma remix powerpointmattcav11
 
proy_colab Iquitos
proy_colab Iquitosproy_colab Iquitos
proy_colab IquitosRockyxpl
 
Exciting features of windows 10 operating system
Exciting features of windows 10 operating systemExciting features of windows 10 operating system
Exciting features of windows 10 operating systemPriceJugaad
 
Operating system history
Operating system historyOperating system history
Operating system historypauldunkirk
 
History of Operating system
History of Operating systemHistory of Operating system
History of Operating systemtarun thakkar
 
Windows Operating System
Windows Operating SystemWindows Operating System
Windows Operating SystemTarun Nayak
 
Ee 1351 power system analysis
Ee 1351 power system analysisEe 1351 power system analysis
Ee 1351 power system analysisHari Kumar
 
A History of Microsoft Windows
A History of Microsoft WindowsA History of Microsoft Windows
A History of Microsoft WindowsDamian T. Gordon
 
Operating Systems Basics
Operating Systems BasicsOperating Systems Basics
Operating Systems Basicsnishantsri
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Managementguest1415ae65
 
Features of windows operating system
Features of windows operating systemFeatures of windows operating system
Features of windows operating systemMohammad Alig
 

Andere mochten auch (15)

Lecture05(control structure part ii)
Lecture05(control structure part ii)Lecture05(control structure part ii)
Lecture05(control structure part ii)
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
 
March newsletter final
March newsletter finalMarch newsletter final
March newsletter final
 
Rusko somebody to love (sigma remix powerpoint
Rusko   somebody to love (sigma remix powerpointRusko   somebody to love (sigma remix powerpoint
Rusko somebody to love (sigma remix powerpoint
 
Rusko somebody to love (sigma remix powerpoint
Rusko   somebody to love (sigma remix powerpointRusko   somebody to love (sigma remix powerpoint
Rusko somebody to love (sigma remix powerpoint
 
proy_colab Iquitos
proy_colab Iquitosproy_colab Iquitos
proy_colab Iquitos
 
Exciting features of windows 10 operating system
Exciting features of windows 10 operating systemExciting features of windows 10 operating system
Exciting features of windows 10 operating system
 
Operating system history
Operating system historyOperating system history
Operating system history
 
History of Operating system
History of Operating systemHistory of Operating system
History of Operating system
 
Windows Operating System
Windows Operating SystemWindows Operating System
Windows Operating System
 
Ee 1351 power system analysis
Ee 1351 power system analysisEe 1351 power system analysis
Ee 1351 power system analysis
 
A History of Microsoft Windows
A History of Microsoft WindowsA History of Microsoft Windows
A History of Microsoft Windows
 
Operating Systems Basics
Operating Systems BasicsOperating Systems Basics
Operating Systems Basics
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
 
Features of windows operating system
Features of windows operating systemFeatures of windows operating system
Features of windows operating system
 

Ähnlich wie Fundamentals of programming final santos

Fundamentals of programming final
Fundamentals of programming finalFundamentals of programming final
Fundamentals of programming finalRicky Recto
 
Looping and switch cases
Looping and switch casesLooping and switch cases
Looping and switch casesMeoRamos
 
Fundamentals of programming finals.ajang
Fundamentals of programming finals.ajangFundamentals of programming finals.ajang
Fundamentals of programming finals.ajangJaricka Angelyd Marquez
 
Switch case and looping statement
Switch case and looping statementSwitch case and looping statement
Switch case and looping statement_jenica
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdfvino108206
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?Hirdesh Vishwdewa
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programmingMukesh Tekwani
 
C Language Presentation.pptx
C Language Presentation.pptxC Language Presentation.pptx
C Language Presentation.pptxPradeepKumar206701
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.gerrell
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping newaprilyyy
 
C language industrial training report
C language industrial training reportC language industrial training report
C language industrial training reportRaushan Pandey
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051ReportKuldeep Kaushik
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diarySHARDA SHARAN
 
Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angelibergonio11339481
 
4 coding from algorithms
4 coding from algorithms4 coding from algorithms
4 coding from algorithmshccit
 
Book management system
Book management systemBook management system
Book management systemSHARDA SHARAN
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfSubramanyambharathis
 
Switch case and looping jam
Switch case and looping jamSwitch case and looping jam
Switch case and looping jamJamaicaAubreyUnite
 
Contact management system
Contact management systemContact management system
Contact management systemSHARDA SHARAN
 

Ähnlich wie Fundamentals of programming final santos (20)

Fundamentals of programming final
Fundamentals of programming finalFundamentals of programming final
Fundamentals of programming final
 
Looping and switch cases
Looping and switch casesLooping and switch cases
Looping and switch cases
 
Fundamentals of programming finals.ajang
Fundamentals of programming finals.ajangFundamentals of programming finals.ajang
Fundamentals of programming finals.ajang
 
Switch case and looping statement
Switch case and looping statementSwitch case and looping statement
Switch case and looping statement
 
My final requirement
My final requirementMy final requirement
My final requirement
 
CS8251_QB_answers.pdf
CS8251_QB_answers.pdfCS8251_QB_answers.pdf
CS8251_QB_answers.pdf
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
 
C Language Presentation.pptx
C Language Presentation.pptxC Language Presentation.pptx
C Language Presentation.pptx
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping new
 
C language industrial training report
C language industrial training reportC language industrial training report
C language industrial training report
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
 
Password protected diary
Password protected diaryPassword protected diary
Password protected diary
 
Fundamentals of programming angeli
Fundamentals of programming angeliFundamentals of programming angeli
Fundamentals of programming angeli
 
4 coding from algorithms
4 coding from algorithms4 coding from algorithms
4 coding from algorithms
 
Book management system
Book management systemBook management system
Book management system
 
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdfINTRODUCTION TO C PROGRAMMING MATERIAL.pdf
INTRODUCTION TO C PROGRAMMING MATERIAL.pdf
 
Switch case and looping jam
Switch case and looping jamSwitch case and looping jam
Switch case and looping jam
 
Contact management system
Contact management systemContact management system
Contact management system
 

KĂŒrzlich hochgeladen

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

KĂŒrzlich hochgeladen (20)

Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAĐĄY_INDEX-DM_23-1-final-eng.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

Fundamentals of programming final santos

  • 1. ‱Switch Case and ‱Looping Statement By:Abigail C.Santos BM 10203 http://eglobiotraining.com/
  • 2. ‱Programming ‱Switch Case The If – else Statement If statement (two alternatives) If statement (One-Alternatives) How to save and run your statement Five Programs that is related on switch case program Output ‱Looping Statement The while Loop The Do
 While Loop The For Loop The Foreach Loop Break and continue statement Output http://eglobiotraining.com/
  • 4. Programming We first define the word “programming”, it is a computer language programmers use to develop applications, scripts, or other set of instructions for a computer to execute. programming is instructing a computer to do something for you with the help of a programming language. The role of a programming language can be described in two ways: Technical: It is a means for instructing a Computer to perform Tasks Conceptual: It is a framework within which we organize our ideas about things and processes. http://eglobiotraining.com/
  • 5. As an individual, I have learned that programming is a very broad because it composes many scripts, applications and can be used to run a program that has been part of the programming language. A programming language should both provide means to describe primitive data and procedures and means to combine and abstract those into more complex ones. http://eglobiotraining.com/
  • 6.  The distinction between data and procedures is not that clear cut. In many programming languages, procedures can be passed as data (to be applied to ``real'' data) and sometimes processed like ``ordinary'' data. Conversely ``ordinary'' data can be turned into procedures by an evaluation mechanism. http://eglobiotraining.com/
  • 7.  If we know how to write a C expression that is equivalent of a question such as “Is resting the value of expression to select a course of action. In C, the statement is the primary selection control structure  Me: it’s hard to write c expression. So, I just copy and paste it into internet.  A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely. http://eglobiotraining.com/
  • 8. At first, programming is confusing because you have so much to understand about codes that will enable to run a program. Programming has applications and program development, the best example for this is the Internet browser
 Programming is a creative process done by programmers to instruct a computer on how to do a task. Programming languages let you use them in different ways, e.g adding numbers, etc
 or storing data on disk for later retrieval. http://eglobiotraining.com/
  • 9. You have to consider languages to run or write your own program, most demanded language in programming is the DEV C++ (a full-featured Integrated Development Environment (IDE)). C++ is one of the most used programming languages in the world. Also known as "C with Classes". New to programming or thinking about it? It might surprise you to know that there are many programmers who program just for fun and it can lead to a job. http://eglobiotraining.com/
  • 10. - A switch, case, select or inspect statement is a type of selection control mechanism that exists in most imperative programming languages such as Pascal, Ada, C/C++, C#, Java, and so on. It is also included in several other types of languages. Its purpose is to allow the value of a variable or expression to control the flow of program execution via a multiway branch (or "goto", one of several labels). The Main Reason using switch case : - To improve clarity, by reducing otherwise repetitive coding, and (if the heuristics permit) also offering the potential for faster execution through easier compiler optimization in many cases. http://eglobiotraining.com/
  • 11. 1. The If – else Statement -The if statement allows the programmer to make decisions within a program. - The general format of an if statement is: If (expression) statement -Where expression represents a relational, equality, or logical expression ( conditional expression) . http://eglobiotraining.com/
  • 12. If statement (two alternatives) Form: If (condition) Note: if condition evaluates to true, then statement is statement; executed and statement is skipped; otherwise, statement is else skipped and statement is executed statement; If statement (One-Alternatives) Form: If (condition) Note: if condition evaluates to true, then statement is statement; executed and statement is skipped Format of the if statement - All if statement examples in this text indent statements. The word else Is typed without indention on a separate line. The format of the if statement makes its meaning apparent and is used solely to improve program readability; The format makes no difference to the computer http://eglobiotraining.com/
  • 13.  There may be a situation when you need to execute a block of code several number of times. In general statements are executed sequentially: The first statement in a function is executed first, followed by the second, and so on.  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: http://eglobiotraining.com/
  • 14.  1. Open Dev C++  2. Click File and choose New  3. Post your Statements  4. after you post your statement  5. Save it .choose file and save or  6. click f9 or you can see it shaped like a square http://eglobiotraining.com/
  • 16. Link: http://gd.tuwien.ac.at/languages/c/programming- bbrown/c_028.htm The above program uses a switch statement to validate and select upon the users input choice, simulating a simple menu of choices. http://eglobiotraining.com/
  • 17. When it compiles and run, this will be it look . The C expression that was type it on Dev C++ The words are “enter in two number  24” http://eglobiotraining.com/
  • 18. Link: http://www.morrowland.com/apron/tutorials/cp p/cpp_switch_case/index.php Example of Switch Case Statement , you Will see the statement on the link that you see in this slide. http://eglobiotraining.com/
  • 19. After I compile it and run it, the statement is now like this. As you Can see after you answer the 1st question the next question appear And after you finish all the question the box will disappear. It means finish. http://eglobiotraining.com/
  • 20. Link: http://www.morrowland.com/apro n/tutorials/cpp/cpp_if_else/index. php Function and target of Programming language : A computer programming language is a language. used to write computer programs, which involve a computer performing some kind of computation or algorithm and possibly control external devices such as printers , disk drives , robots, and so on. http://eglobiotraining.com/
  • 21. When the statement was done this will it be look like. I got this from the URL . The URL was posted on the previous slide http://eglobiotraining.com/
  • 22. http://msdn.microsoft.com/en-us/library/66k51h7a(v=vs.80).aspx Did You Know? The first programming languages predate the modern computer. The 19th century saw the invention of "programmable" looms and player piano scrolls, both of which implemented examples of domain- specific languages. http://eglobiotraining.com/
  • 23. Did You Know ? All programming languages have some primitive building blocks for the description of data and the processes or transformations applied to them(like the addition of two numbers or the selection of an item from a collection). These primitives are defined by syntactic and semantic rules which describe their structure and meaning respectively. http://eglobiotraining.com/
  • 24. Link: http://www.cfanatic.com/topic4267/ http://eglobiotraining.com/
  • 27. Looping Statements - Loops execute a block of code a specified number of times, or while a specified condition is true. - in PHP, the following looping statements are used: *The while Loop * The Do
 While Loop * The For Loop *The Foreach Loop *Break and continue statement http://www.slideshare.net/ilakkiya/looping-statement http://eglobiotraining.com/
  • 28. While structure is another type of loop statements, where the condition is checked at first, the iteration will not stop even if the value changes while executing statements. Form: While(condition) { code to be executed; } http://www.slideshare.net/ilakkiya/looping-statement http://eglobiotraining.com/
  • 29.  Dowhile statement is same as the while statement , the only difference is that it evaluates the expression at the end. Form: do { code to be executed; } while (condition): http://www.slideshare.net/ilakkiya/looping-statement http://eglobiotraining.com/
  • 30.  The for loop is used when you know in advance how many times the script should run.  Be for statement takes three expressions inside its parentheses separated by semi-colons. When the for loop executes, the following occurs:  The initializing expression is executed. This expression usually initializes one or more loop counter, but the syntax allow expression any degree of complexity.  The condition expression is evaluated. Of the value of condition is true, the loop statements execute. If the value of condition is false, the for loop terminates.  http://www.slideshare.net/ilakkiya/looping-statement http://eglobiotraining.com/
  • 31. Form: for {initialization; condition: increment ) { code to be executed } http://www.slideshare.net/ilakkiya/looping-statement http://eglobiotraining.com/
  • 32.  For Each structure is a loop structure used for arrays Form: foreach(array as value) { code to be executed } Foreach (array as key => value) { code to be executed http://www.slideshare.net/ilakkiya/looping-statement } http://eglobiotraining.com/
  • 33.  Breakends the execution of the for, for each, while, do-while or switch statement. Form: * Break ( optional numeric argument) http://www.slideshare.net/ilakkiya/looping-statement http://eglobiotraining.com/
  • 34.  “Continue” is used to skip the current loop iteration and continue with the next iteration of the loop. But “Break” is to exit from the whole loop. Form: * Break ( optional numeric argument) http://www.slideshare.net/ilakkiya/looping-statement http://eglobiotraining.com/
  • 41. http://cprogramminglanguage.net/c-break-continue-statements.aspx Break and continue http://eglobiotraining.com/
  • 43. http://www.w3schools.com/php/php_looping_for.asp For each loop http://eglobiotraining.com/
  • 45.  Slideshare  account :abie santos  http://www.slideshare.net/abiesantos http://eglobiotraining.com/
  • 46. In Partial fulfillment of requirements in Fundamental of Programming Submitted to : Prof. Erwin Globio http://eglobiotraining.com/ Submitted By: Abigail C. Santos http://eglobiotraining.com/