Top Banner
http://eglobiotraining.com/ http://eglobiotraining.com/ Project Project in in Fundamental Fundamental Programming Programming By: Eunice B. By: Eunice B. Socubus Socubus BM10203 BM10203
35
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Project

http://eglobiotraining.com/http://eglobiotraining.com/

ProjectProjectinin

Fundamental Fundamental ProgrammingProgramming

By: Eunice B. SocubusBy: Eunice B. Socubus

BM10203BM10203

Page 2: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Looping StatementLooping Statement

&&

Switch CaseSwitch Case

Page 3: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Table Of Content:Table Of Content:

ProgrammingProgramming LoopingLooping

For For

WhileWhile

Do whileDo while

Switch CaseSwitch CaseIfIf

ElseElse

ThenThen

Page 4: Project

http://eglobiotraining.com/http://eglobiotraining.com/

ProgrammingProgramming A A programmingprogramming language language is an artificial language designed to  is an artificial language designed to

communicate instructions to a machine, particularly a computer. communicate instructions to a machine, particularly a computer. ProgrammingProgramming languages can be used to create programs that control the languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely.behavior of a machine and/or to express algorithms precisely.

The earliest The earliest programmingprogramming languages predate the invention of the computer, languages predate the invention of the computer, and were used to direct the behavior of machines such as Jacquard looms and were used to direct the behavior of machines such as Jacquard looms and player pianos citationand player pianos citation needed]. Thousands of different needed]. Thousands of different programmingprogramming languages have been created, mainly in the computer field, with many languages have been created, mainly in the computer field, with many more being created every year. Most more being created every year. Most programmingprogramming languages describe languages describe computation in an imperative style, i.e., as a sequence of commands, computation in an imperative style, i.e., as a sequence of commands, although some languages, such as those that support functional although some languages, such as those that support functional programming programming or logic programming, use alternative forms of description.or logic programming, use alternative forms of description.

The description of a The description of a programmingprogramming language is usually split into the two language is usually split into the two components of Syntax (form) and semantics (meaning). Some languages components of Syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C are defined by a specification document (for example, the C programmingprogramming language is specified by an ISO Standard), while other languages, such language is specified by an ISO Standard), while other languages, such as Perl 5 and earlier, have a dominant implementation that is used as as Perl 5 and earlier, have a dominant implementation that is used as a reference.a reference.

Page 5: Project

http://eglobiotraining.com/http://eglobiotraining.com/

A A programmingprogramming language is a notation for writing programs, which are specifications of a language is a notation for writing programs, which are specifications of a computation or algorithm. Some, but not all, authors restrict the term "computation or algorithm. Some, but not all, authors restrict the term "programming programming language" language" to those languages that can express to those languages that can express allall possible algorithms. Traits often considered important  possible algorithms. Traits often considered important for what constitutes a for what constitutes a programmingprogramming language include: language include:

Function and target:Function and target: A  A computer computer programmingprogramming language language is a language used to write computer  is a language used to write computer programs, which involve a computer performing some kind of computation or algorithm and 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. For possibly control external devices such as printers, disk drives, robots, and so on. For example PostScript programs are frequently created by another program to control a computer example PostScript programs are frequently created by another program to control a computer printer or display. More generally, a printer or display. More generally, a programmingprogramming language may describe computation on language may describe computation on some, possibly abstract, machine. It is generally accepted that a complete specification for a some, possibly abstract, machine. It is generally accepted that a complete specification for a programmingprogramming language includes a description, possibly idealized, of a machine or processor language includes a description, possibly idealized, of a machine or processor for that language. In most practical contexts, a programming language involves a computer; for that language. In most practical contexts, a programming language involves a computer; consequently, programming languages are usually defined and studied this way. Programming consequently, programming languages are usually defined and studied this way. Programming languages differ from natural languages in that natural languages are only used for interaction languages differ from natural languages in that natural languages are only used for interaction between people, while programming languages also allow humans to communicate between people, while programming languages also allow humans to communicate instructions to machines.instructions to machines.

Abstractions:Abstractions: Programming languages usually contain abstractions for defining and  Programming languages usually contain abstractions for defining and manipulating data structures or controlling the flow of execution. The practical necessity that a manipulating data structures or controlling the flow of execution. The practical necessity that a programming language support adequate abstractions is expressed by the abstraction programming language support adequate abstractions is expressed by the abstraction principle; this principle is sometimes formulated as recommendation to the programmer to principle; this principle is sometimes formulated as recommendation to the programmer to make proper use of such abstractions.make proper use of such abstractions.

Expressive power:Expressive power: The theory of computation classifies languages by the computations they  The theory of computation classifies languages by the computations they are capable of expressing. All Turing complete languages can implement the same set are capable of expressing. All Turing complete languages can implement the same set of algorithms. ANSI/ISO SQL and Charity are examples of languages that are not Turing of algorithms. ANSI/ISO SQL and Charity are examples of languages that are not Turing complete, yet often called programming languages.complete, yet often called programming languages.

Page 6: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Looping StatementsLooping Statements Loops are used to repeat a block of code in Loops are used to repeat a block of code in programmingprogramming. Being able to . Being able to

have your program repeatedly execute a block of code is one of the most have your program repeatedly execute a block of code is one of the most basic but useful tasks in basic but useful tasks in programmingprogramming. There are three types of Looping . There are three types of Looping Statement, Statement,

These are:These are:

For For

WhileWhile

Do whileDo while

Page 7: Project

http://eglobiotraining.com/http://eglobiotraining.com/

For Loop Statement For Loop Statement

Terminates the Terminates the looploop or  or switchswitch statement and  statement and transfers execution to the statement transfers execution to the statement immediately following the loop or switch. immediately following the loop or switch.

Page 8: Project

http://eglobiotraining.com/http://eglobiotraining.com/

While Loop StatementWhile Loop Statement

Repeats a statement or group of statements Repeats a statement or group of statements until a given condition is true. It tests the until a given condition is true. It tests the condition before executing the loop body. condition before executing the loop body.

Page 9: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Do…While Loop StatementDo…While Loop Statement

Like a while statement, except that it tests the Like a while statement, except that it tests the condition at the end of the loop body.condition at the end of the loop body.

Page 10: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Switch Case StatementSwitch Case Statement

• In In programmingprogramming, a , a switchswitch, , casecase, , selectselect or  or inspectinspect statement is  statement is a type of selection control mechanism that exists in most a type of selection control mechanism that exists in most imperative imperative programmingprogramming languages such as Pascal, Ada, C/C+ languages such as Pascal, Ada, C/C++, C#, Java, and so on. It is also included in several other types +, C#, Java, and so on. It is also included in several other types of languages.of languages.

Page 11: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Sample ProgramsSample Programs

Page 12: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Codes & Outputs in Switch CaseCodes & Outputs in Switch Case

Page 13: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This Program uses a Switch Case Statement so that the user will have a choice. It contains days,

each days have a own number to know where do they belong.

Page 14: Project

http://eglobiotraining.com/http://eglobiotraining.com/

When you run the program, thiswill be the sample output. The

Program wants you to give a numberand then it will give you the Day.

Page 15: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This program is a Grading System, it Converts percent into average.

Page 16: Project

http://eglobiotraining.com/http://eglobiotraining.com/

When you run the program, this is the sample output. The conversion is shown

in the box.

Page 17: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This program is use for ATM machines, it computes Credit Limit and Total Purchased.

Page 18: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This output shown the Computation and the remaining

credit.

Page 19: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This program is for reservationof seats and it will compute thetotal price of the reservation.

Page 20: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Here is the output of the program,it contains how the reservation is done,

the price and the Total Sale.

Page 21: Project

http://eglobiotraining.com/http://eglobiotraining.com/

You will just type what numbers youlike most and letters in this

Program.

Page 22: Project

http://eglobiotraining.com/http://eglobiotraining.com/

In this output, when you choose a numberAnd letter it will simply reply.

Page 23: Project

http://eglobiotraining.com/http://eglobiotraining.com/

Codes & Outputs in Looping Codes & Outputs in Looping StatementStatement

Page 24: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This program uses Looping Statement, this program show

theRows and columns.

Page 25: Project

http://eglobiotraining.com/http://eglobiotraining.com/

You will just simply input number of rows and columns, the program will automatically

show the output.

Page 26: Project

http://eglobiotraining.com/http://eglobiotraining.com/

In this program, I just use DO and While.

Page 27: Project

http://eglobiotraining.com/http://eglobiotraining.com/

The output shows numbers 10 up to 99 in

order

Page 28: Project

http://eglobiotraining.com/http://eglobiotraining.com/

I use For Statement so that the program will loop.

Page 29: Project

http://eglobiotraining.com/http://eglobiotraining.com/

The output is this, when you input a number, it will show

the number, square, and cube.

Page 30: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This program will compute

the Total Sales of the Number of Seats and

Price.

Page 31: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This is where you will see the

computation and how the program

run.

Page 32: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This code is just simply display numbers 0 to 8.

Page 33: Project

http://eglobiotraining.com/http://eglobiotraining.com/

This is the sample output of the

program.

Page 34: Project

http://eglobiotraining.com/http://eglobiotraining.com/

  Slideshare.netSlideshare.net Account: socubus0527Account: socubus0527 http://www.slideshare.net/http://www.slideshare.net/

recto11369121/fundamentals-of-recto11369121/fundamentals-of-programming-final programming-final

Page 35: Project

http://eglobiotraining.com/http://eglobiotraining.com/

In partial fulfillment of requirements in In partial fulfillment of requirements in Fundamental Programming Fundamental Programming

Submitted to: Prof. Erwin Globio

http://eglobiotraining.com/

Submitted by: Eunice B. Socubus