Final requirement for programming-Bonifacio, Mary Clemence
Final Requirement for ProgrammingSwitch Case and Looping http://eglobiotraining.com/
What is Programming? Programming is coding, modeling,simulating or presenting the solution to aproblem, by representing facts, data orinformation using pre-defined rules andsemantics, on a computer or any otherdevice for automation. Programming is the art and science oftranslating a set of ideas into a program - alist of instructions a computer can follow.The person writing a program is known as aprogrammer (also a coder). http://eglobiotraining.com/
A programming language is a stylizedcommunication technique intended to beused for controlling the behavior of machine(computer). Like human languagesprogramming languages have syntactic andsemantic rules used to define meaning. Thousands of different programminglanguages have been created and new onesare created every year. The development of programminglanguages follows closely the developmentof the physical and electronic processesused in today’s computers. http://eglobiotraining.com/
The term programming language usuallyrefers to high-level languages, such asBASI, C, CC++, COBOL, FORTRAN, Ada, andPascal. Each language has a unique set ofkeywords (words that programmingunderstands) and a special syntax fororganizing program instructions. High-level programming languages, whilesimple compared to human languages, aremore complex than the languages thecomputer actually understands, calledmachine languages. Each different type ofCPU has its own unique machine language. http://eglobiotraining.com/
C Programming is a powerful systemprogramming language C++ Programming is an excellentgeneral purpose programming language Dev-C++ is a specialized programmingtool which allows to edit and compile codesof applications based on C/C++. http://eglobiotraining.com/
As a student, I have to learn and understandprogramming, I have to be familiar with it.Because programming is one of the subjectsthat I’ am currently taking this semester. At first, I find programming very difficult andconfusing. You should know first the basic rulesin programming for you to understand it better.There are lots of things that you have toconsider in programming, especially whenentering the codes, you must be very carefulwith it. http://eglobiotraining.com/
Switch Case Switch statement (aprogramming language) comparesthe value of an expression againsta list of integers or characterconstants. The list of constantsare 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 ofthe Program that I have tested and The Output Program Using Dev C++ http://eglobiotraining.com/
This is the output program of switch case 1.It says that there “Enter the day of the weekbetween 1-7”, if you enter a number between1-7, the day that correspond to that numberwill appear. For example, you entered number3, Wednesday will appear because it is the 3rd http://eglobiotraining.com/
This is the output program of switchcase 2.The first output shows that the numberentered is equal to n which isequivalent to 1,2,3. And the secondoutput shows that the number entered http://eglobiotraining.com/
This is the output program of switch case 3.In programming, we can create statement that willask you to choose your answer from its choicesand will tell you what you have chose, just like theoutput above. Using switch case statement I find http://eglobiotraining.com/programming a little bit fun.
This is the output program of switch case 4.This program shows the computation of thescores of the student. It shows there thename of the student, the total no. of scoreentered, the total score and the totalaverage score. http://eglobiotraining.com/
This is the output program of Loop 2.Programming can also createstatements like counting numbers, inthis program it ask to count from 20 to http://eglobiotraining.com/45 by 5. This is a for loop statement.
This is the output program of Loop 3.In programming, we can create statement that will not stop unlessyou enter a valid variable. The first output shows “please enter aninteger between 1 and 10”, if enter a valid number then theprogram will close. In the second output it shows there that in thefirst statement the number entered is invalid, the statement willkeep on repeating and it will only stop until you enter a valid http://eglobiotraining.com/number. This is a while loop statement.
This is the output program of Loop 4.There are some statements in programmingthat are easy to do, just like this one. It is awhile loop statement, this program is onlysimple you can only see there the word http://eglobiotraining.com/“Hello”.
This is the output program of loop 5.We can also use programming in solving somemathematical problems. This is a while loopstatement, as you can see there it asks you to“enter number of apples ate” this will show fivetimes every time you enter a number and the total http://eglobiotraining.com/
Submitted to:Prof. Erwin Globiohttp://eglobiotraining.com/Submitted by:Bonifacio, Mary Clemence A.BM10203 http://eglobiotraining.com/
A particular slide catching your eye?
Clipping is a handy way to collect important slides you want to go back to later.