SlideShare a Scribd company logo
1 of 35
Final Requirement for
        Programming


Switch Case and Looping


                http://eglobiotraining.com/
What is Programming?
    Programming is coding, modeling,
simulating or presenting the solution to a
problem, by representing facts, data or
information using pre-defined rules and
semantics, on a computer or any other
device for automation.
    Programming is the art and science of
translating a set of ideas into a program - a
list of instructions a computer can follow.
The person writing a program is known as a
programmer (also a coder).
                         http://eglobiotraining.com/
A programming language is a stylized
communication technique intended to be
used for controlling the behavior of machine
(computer). Like human languages
programming languages have syntactic and
semantic rules used to define meaning.
   Thousands of different programming
languages have been created and new ones
are created every year.
   The development of programming
languages follows closely the development
of the physical and electronic processes
used in today’s computers.
                        http://eglobiotraining.com/
The term programming language usually
refers to high-level languages, such as
BASI, C, CC++, COBOL, FORTRAN, Ada, and
Pascal. Each language has a unique set of
keywords (words that programming
understands) and a special syntax for
organizing program instructions.
   High-level programming languages, while
simple compared to human languages, are
more complex than the languages the
computer actually understands, called
machine languages. Each different type of
CPU has its own unique machine language.
                        http://eglobiotraining.com/
C Programming is a powerful system
programming language

   C++ Programming is an excellent
general purpose programming language

   Dev-C++ is a specialized programming
tool which allows to edit and compile codes
of applications based on C/C++.



                       http://eglobiotraining.com/
As a student, I have to learn and understand
programming, I have to be familiar with it.
Because programming is one of the subjects
that I’ am currently taking this semester.
    At first, I find programming very difficult and
confusing. You should know first the basic rules
in programming for you to understand it better.
There are lots of things that you have to
consider in programming, especially when
entering the codes, you must be very careful
with it.




                              http://eglobiotraining.com/
Switch Case
   Switch statement (a
programming language) compares
the value of an expression against
a list of integers or character
constants. The list of constants
are listed using the "case"
statement along with a "break"
statement to end the execution.

                   http://eglobiotraining.com/
The switch case statement is useful programming and it is a better
   way of writing a program when a series of if elses occurs. The
                      general format for this is,




The keyword break must be included at the end of each case
  statement. The default clause is optional, and is executed if
  the cases are not met. The right brace at the end signifies
  the end of the case selections.
                                         http://eglobiotraining.com/
Rules for switch statements

• values for 'case' must be integer
  or character
• constants the order of the 'case'
  statements is unimportant
• the default clause may occur first
  (convention places it last)
• you cannot use expressions or
  ranges

                    http://eglobiotraining.com/
Loops
    A loop is a programming
 language, it is a way of repeating
 a statement a number of times
 until some way of ending the loop
 occurs.
These include following categories:
              1. for loop
            2. while loop
             3. do while
                     http://eglobiotraining.com/
Example of For Loop




                  http://eglobiotraining.com/
Example of While Loop




                   http://eglobiotraining.com/
Example of Do While Loop




                    http://eglobiotraining.com/
The Codes and Explanations of
the Program that I have tested
             and
         The Output
   Program Using Dev C++



                 http://eglobiotraining.com/
Switch Case 1




                http://eglobiotraining.com/
This is the output program of switch case 1.
It says that there “Enter the day of the week
between 1-7”, if you enter a number between
1-7, the day that correspond to that number
will appear. For example, you entered number
3, Wednesday will appear because it is the 3rd
                           http://eglobiotraining.com/
Switch Case 2




                http://eglobiotraining.com/
This is the output program of switch
case 2.
The first output shows that the number
entered is equal to n which is
equivalent to 1,2,3. And the second
output shows that the number entered
                          http://eglobiotraining.com/
Switch Case 3




                http://eglobiotraining.com/
This is the output program of switch case 3.
In programming, we can create statement that will
ask you to choose your answer from its choices
and will tell you what you have chose, just like the
output above. Using switch case statement I find
                              http://eglobiotraining.com/
programming a little bit fun.
Switch Case 4




                http://eglobiotraining.com/
This is the output program of switch case 4.
This program shows the computation of the
scores of the student. It shows there the
name of the student, the total no. of score
entered, the total score and the total
average score.              http://eglobiotraining.com/
Switch Case 5




                http://eglobiotraining.com/
This is the output program of switch case 5.
The program ask to enter a number between 1 to
5, I entered 5 and the word five appeared.
                            http://eglobiotraining.com/
Looping 1




            http://eglobiotraining.com/
This is the output program of Looping 1.
Here, I used the for loop in making this
program. It shows there numbers starting
from 0 to 10.
                        http://eglobiotraining.com/
Looping 2




            http://eglobiotraining.com/
This is the output program of Loop 2.
Programming can also create
statements like counting numbers, in
this program it ask to count from 20 to
                          http://eglobiotraining.com/
45 by 5. This is a for loop statement.
Looping 3




            http://eglobiotraining.com/
This is the output program of Loop 3.
In programming, we can create statement that will not stop unless
you enter a valid variable. The first output shows “please enter an
integer between 1 and 10”, if enter a valid number then the
program will close. In the second output it shows there that in the
first statement the number entered is invalid, the statement will
keep on repeating and it will only stop until you enter a valid
                                         http://eglobiotraining.com/
number. This is a while loop statement.
Looping 4




            http://eglobiotraining.com/
This is the output program of Loop 4.
There are some statements in programming
that are easy to do, just like this one. It is a
while loop statement, this program is only
simple you can only see there the word
                             http://eglobiotraining.com/
“Hello”.
Looping 5




            http://eglobiotraining.com/
This is the output program of loop 5.
We can also use programming in solving some
mathematical problems. This is a while loop
statement, as you can see there it asks you to
“enter number of apples ate” this will show five
times every time you enter a number and the total
                              http://eglobiotraining.com/
Submitted to:
Prof. Erwin Globio
http://eglobiotraining.com/




Submitted by:
Bonifacio, Mary Clemence A.
BM10203


                              http://eglobiotraining.com/

More Related Content

What's hot

Margareth lota
Margareth lotaMargareth lota
Margareth lotamaggybells
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodologyarchikabhatia
 
265 ge8151 problem solving and python programming - 2 marks with answers
265   ge8151 problem solving and python programming - 2 marks with answers265   ge8151 problem solving and python programming - 2 marks with answers
265 ge8151 problem solving and python programming - 2 marks with answersvithyanila
 
Types of Programming Errors
Types of Programming ErrorsTypes of Programming Errors
Types of Programming ErrorsNeha Sharma
 
C introduction
C introductionC introduction
C introductionKamran
 
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1ILearn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1Ilivecoding.tv
 
Fundamentals of programming
Fundamentals of programmingFundamentals of programming
Fundamentals of programmingKaycee Parcon
 
C and its errors
C and its errorsC and its errors
C and its errorsJunaid Raja
 
C Programming- Harsh Sharma
C Programming- Harsh SharmaC Programming- Harsh Sharma
C Programming- Harsh SharmaHarsh Sharma
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#Sireesh K
 
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
 

What's hot (20)

Margareth lota
Margareth lotaMargareth lota
Margareth lota
 
Types of errors 2019
Types of errors 2019Types of errors 2019
Types of errors 2019
 
Intro cpp
Intro cppIntro cpp
Intro cpp
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodology
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
265 ge8151 problem solving and python programming - 2 marks with answers
265   ge8151 problem solving and python programming - 2 marks with answers265   ge8151 problem solving and python programming - 2 marks with answers
265 ge8151 problem solving and python programming - 2 marks with answers
 
How c/c++ works
How c/c++ worksHow c/c++ works
How c/c++ works
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
Types of Programming Errors
Types of Programming ErrorsTypes of Programming Errors
Types of Programming Errors
 
C introduction
C introductionC introduction
C introduction
 
Programming Methodology
Programming MethodologyProgramming Methodology
Programming Methodology
 
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1ILearn Programming with Livecoding.tv http://goo.gl/tIgO1I
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
 
Fundamentals of programming
Fundamentals of programmingFundamentals of programming
Fundamentals of programming
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
C and its errors
C and its errorsC and its errors
C and its errors
 
C Programming- Harsh Sharma
C Programming- Harsh SharmaC Programming- Harsh Sharma
C Programming- Harsh Sharma
 
difference between c c++ c#
difference between c c++ c#difference between c c++ c#
difference between c c++ c#
 
88 c-programs
88 c-programs88 c-programs
88 c-programs
 
The basics of c programming
The basics of c programmingThe basics of c programming
The basics of c programming
 
over all view programming to computer
over all view programming to computer over all view programming to computer
over all view programming to computer
 

Similar to Final requirement for programming-Bonifacio, Mary Clemence

Fundamentals of programming final
Fundamentals of programming finalFundamentals of programming final
Fundamentals of programming finalRicky Recto
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!olracoatalub
 
Switch case and looping statement
Switch case and looping statementSwitch case and looping statement
Switch case and looping statement_jenica
 
Looping and switch cases
Looping and switch casesLooping and switch cases
Looping and switch casesMeoRamos
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi pptmark-asoi
 
Deguzmanpresentationprogramming
DeguzmanpresentationprogrammingDeguzmanpresentationprogramming
Deguzmanpresentationprogrammingdeguzmantrisha
 
My programming final proj. (1)
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)aeden_brines
 
Fundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinarurumedina
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingHamad Odhabi
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.gerrell
 
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 new
Switch case and looping newSwitch case and looping new
Switch case and looping newaprilyyy
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and loopingChaAstillas
 
PYTHON NOTES
PYTHON NOTESPYTHON NOTES
PYTHON NOTESNi
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own languageAndrea Tino
 

Similar to Final requirement for programming-Bonifacio, Mary Clemence (20)

Fundamentals of programming final
Fundamentals of programming finalFundamentals of programming final
Fundamentals of programming final
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
 
Switch case and looping statement
Switch case and looping statementSwitch case and looping statement
Switch case and looping statement
 
Looping and switch cases
Looping and switch casesLooping and switch cases
Looping and switch cases
 
My final requirement
My final requirementMy final requirement
My final requirement
 
Mark asoi ppt
Mark asoi pptMark asoi ppt
Mark asoi ppt
 
Deguzmanpresentationprogramming
DeguzmanpresentationprogrammingDeguzmanpresentationprogramming
Deguzmanpresentationprogramming
 
My programming final proj. (1)
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)
 
Fundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medina
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
 
Macasu, gerrell c.
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.
 
Fundamentals of programming finals.ajang
Fundamentals of programming finals.ajangFundamentals of programming finals.ajang
Fundamentals of programming finals.ajang
 
Switch case and looping new
Switch case and looping newSwitch case and looping new
Switch case and looping new
 
How a Compiler Works ?
How a Compiler Works ?How a Compiler Works ?
How a Compiler Works ?
 
Switch case and looping jam
Switch case and looping jamSwitch case and looping jam
Switch case and looping jam
 
Switch case and looping
Switch case and loopingSwitch case and looping
Switch case and looping
 
Computer
ComputerComputer
Computer
 
PYTHON NOTES
PYTHON NOTESPYTHON NOTES
PYTHON NOTES
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
 
Chapter 2- Prog101.ppt
Chapter 2- Prog101.pptChapter 2- Prog101.ppt
Chapter 2- Prog101.ppt
 

Final requirement for programming-Bonifacio, Mary Clemence

  • 1. Final Requirement for Programming Switch Case and Looping http://eglobiotraining.com/
  • 2. What is Programming? Programming is coding, modeling, simulating or presenting the solution to a problem, by representing facts, data or information using pre-defined rules and semantics, on a computer or any other device for automation. Programming is the art and science of translating a set of ideas into a program - a list of instructions a computer can follow. The person writing a program is known as a programmer (also a coder). http://eglobiotraining.com/
  • 3. A programming language is a stylized communication technique intended to be used for controlling the behavior of machine (computer). Like human languages programming languages have syntactic and semantic rules used to define meaning. Thousands of different programming languages have been created and new ones are created every year. The development of programming languages follows closely the development of the physical and electronic processes used in today’s computers. http://eglobiotraining.com/
  • 4. The term programming language usually refers to high-level languages, such as BASI, C, CC++, COBOL, FORTRAN, Ada, and Pascal. Each language has a unique set of keywords (words that programming understands) and a special syntax for organizing program instructions. High-level programming languages, while simple compared to human languages, are more complex than the languages the computer actually understands, called machine languages. Each different type of CPU has its own unique machine language. http://eglobiotraining.com/
  • 5. C Programming is a powerful system programming language C++ Programming is an excellent general purpose programming language Dev-C++ is a specialized programming tool which allows to edit and compile codes of applications based on C/C++. http://eglobiotraining.com/
  • 6. As a student, I have to learn and understand programming, I have to be familiar with it. Because programming is one of the subjects that I’ am currently taking this semester. At first, I find programming very difficult and confusing. You should know first the basic rules in programming for you to understand it better. There are lots of things that you have to consider in programming, especially when entering the codes, you must be very careful with it. http://eglobiotraining.com/
  • 7. Switch Case Switch statement (a programming language) compares the value of an expression against a list of integers or character constants. The list of constants are listed using the "case" statement along with a "break" statement to end the execution. http://eglobiotraining.com/
  • 8. The switch case statement is useful programming and it is a better way of writing a program when a series of if elses occurs. The general format for this is, The keyword break must be included at the end of each case statement. The default clause is optional, and is executed if the cases are not met. The right brace at the end signifies the end of the case selections. http://eglobiotraining.com/
  • 9. Rules for switch statements • values for 'case' must be integer or character • constants the order of the 'case' statements is unimportant • the default clause may occur first (convention places it last) • you cannot use expressions or ranges http://eglobiotraining.com/
  • 10. Loops A loop is a programming language, it is a way of repeating a statement a number of times until some way of ending the loop occurs. These include following categories: 1. for loop 2. while loop 3. do while http://eglobiotraining.com/
  • 11. Example of For Loop http://eglobiotraining.com/
  • 12. Example of While Loop http://eglobiotraining.com/
  • 13. Example of Do While Loop http://eglobiotraining.com/
  • 14. The Codes and Explanations of the Program that I have tested and The Output Program Using Dev C++ http://eglobiotraining.com/
  • 15. Switch Case 1 http://eglobiotraining.com/
  • 16. This is the output program of switch case 1. It says that there “Enter the day of the week between 1-7”, if you enter a number between 1-7, the day that correspond to that number will appear. For example, you entered number 3, Wednesday will appear because it is the 3rd http://eglobiotraining.com/
  • 17. Switch Case 2 http://eglobiotraining.com/
  • 18. This is the output program of switch case 2. The first output shows that the number entered is equal to n which is equivalent to 1,2,3. And the second output shows that the number entered http://eglobiotraining.com/
  • 19. Switch Case 3 http://eglobiotraining.com/
  • 20. This is the output program of switch case 3. In programming, we can create statement that will ask you to choose your answer from its choices and will tell you what you have chose, just like the output above. Using switch case statement I find http://eglobiotraining.com/ programming a little bit fun.
  • 21. Switch Case 4 http://eglobiotraining.com/
  • 22. This is the output program of switch case 4. This program shows the computation of the scores of the student. It shows there the name of the student, the total no. of score entered, the total score and the total average score. http://eglobiotraining.com/
  • 23. Switch Case 5 http://eglobiotraining.com/
  • 24. This is the output program of switch case 5. The program ask to enter a number between 1 to 5, I entered 5 and the word five appeared. http://eglobiotraining.com/
  • 25. Looping 1 http://eglobiotraining.com/
  • 26. This is the output program of Looping 1. Here, I used the for loop in making this program. It shows there numbers starting from 0 to 10. http://eglobiotraining.com/
  • 27. Looping 2 http://eglobiotraining.com/
  • 28. This is the output program of Loop 2. Programming can also create statements like counting numbers, in this program it ask to count from 20 to http://eglobiotraining.com/ 45 by 5. This is a for loop statement.
  • 29. Looping 3 http://eglobiotraining.com/
  • 30. This is the output program of Loop 3. In programming, we can create statement that will not stop unless you enter a valid variable. The first output shows “please enter an integer between 1 and 10”, if enter a valid number then the program will close. In the second output it shows there that in the first statement the number entered is invalid, the statement will keep on repeating and it will only stop until you enter a valid http://eglobiotraining.com/ number. This is a while loop statement.
  • 31. Looping 4 http://eglobiotraining.com/
  • 32. This is the output program of Loop 4. There are some statements in programming that are easy to do, just like this one. It is a while loop statement, this program is only simple you can only see there the word http://eglobiotraining.com/ “Hello”.
  • 33. Looping 5 http://eglobiotraining.com/
  • 34. This is the output program of loop 5. We can also use programming in solving some mathematical problems. This is a while loop statement, as you can see there it asks you to “enter number of apples ate” this will show five times every time you enter a number and the total http://eglobiotraining.com/
  • 35. Submitted to: Prof. Erwin Globio http://eglobiotraining.com/ Submitted by: Bonifacio, Mary Clemence A. BM10203 http://eglobiotraining.com/