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/
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/
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/
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.
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/
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/
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/
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.
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.
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”.
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/