1.3K views

Uploaded by sullivan583

- P03 - Variables.pdf
- P02 - First Program
- P04 - Arithmetic Operators 1.pdf
- Java - Operators 2
- Number Systems
- Woeksheet - Number Systems
- N01 - Logic Circuits
- Java
- P05 - Arithmetic Operators 2
- H02 - Number Systems
- P06 - Keyboard Entry
- Java - External Classes
- Number Systems Part2
- H01 - Logic Circuits
- JAVA - variables.pdf
- Lesson 1_Code Design
- PROG0101_CH03
- Introduction to Programming With Xojo
- Sia Ch3(Guidelinesflowchart)
- C chapter part 03

You are on page 1of 17

Planning Programs

There are two ways of planning a program; 1. Pseudo-code = makes use of English statements to plot the program 2. Flowcharts = use graphical symbols

Example

class VariablesExample { public static void main (String args[]){ //variables are declared and assigned int N1 = 50; int N2 = 13; int tot; //the total of variables N1 and N2 //is stored in tot tot = N1 + N2; //Finally, we can show the result System.out.println(tot); } }

Pseudo-code Plan

1. Start 2. Store 50 in N1. 3. Store 13 in N2. 4. Add N1 to N2 and store result in tot. 5. Display the value in tot. 6. Stop

Flowchart Plan

Start

N1 = 50 N2 = 13 tot = N1 + N2

Display tot

End

We plan our programs in order to know what we will be doing before we start coding

With a plan it will be much easier to know what structure our program will have

Planning makes programming much easier

Flowcharts

A flowchart is basically a graphical presentation of our program A flowchart is very is to read and understand Flowcharts break down our programs into many steps

Flowchart Symbols

Terminator

The terminator is used to show 1. The start and 2. The end of a program

START END

Process

N1 = 50 N2 = 13

Decision

Decision are used when we have a comparison Decisions have two outputs which are YES or NO.

Is it Raining ?

YES

NO

Input/Output

The Input/ Output symbol is used 1. When the program requires and input 2. When the program results in an output

Display tot

Try it out

class Variable{ Create public static void main (String args[]){ //variables are declared and assigned 1. The pseudo-codes plan int N1 = 20; 2. The flowchart plan int N2 = 10; int tot; for the following program; int tot2; //tot1 and tot 2 declared tot = N1 + N2; tot2 = N1 N2; //Finally, we can show the result System.out.println(tot2); } }

Arithmetic Operators

The basic arithmetic operators ; 1. + (addition) These are called 2. - (subtraction) binary operators 3. / (division) because they need 4. * (multiplication) to use at least two 5. % (remainder) variables

Unary Operators

These only need one variable 1. ++ (increment by 1) 2. -- (decrement by 1) 3. variable += x (same as variable = variable + x)

variable -= x (same as variable = variable - x) 5. variable *= x (same as variable = variable * x) 6. variable /= x (same as variable = variable / x) 7. variable %= x (same as variable = variable %

4.

Combining Operators

X = 10 + 4 * 3 / 2;

1. 2. 3. 4. 5.

Multiplication Division Remainder Addition Subtraction

10 + 4 * 3 / 2 10 + 12 / 2 10 + 6 16

Use of Brackets

When we use brackets in our formula we are telling the program which operations to calculate first

X = (10 + 4) * 3 / 2; (10 + 4 ) * 3 / 2 14 * 3 / 2 42 / 2 21

- P03 - Variables.pdfUploaded bysullivan583
- P02 - First ProgramUploaded bysullivan583
- P04 - Arithmetic Operators 1.pdfUploaded bysullivan583
- Java - Operators 2Uploaded bysullivan583
- Number SystemsUploaded bysullivan583
- Woeksheet - Number SystemsUploaded bysullivan583
- N01 - Logic CircuitsUploaded bysullivan583
- JavaUploaded bysullivan583
- P05 - Arithmetic Operators 2Uploaded bysullivan583
- H02 - Number SystemsUploaded bysullivan583
- P06 - Keyboard EntryUploaded bysullivan583
- Java - External ClassesUploaded bysullivan583
- Number Systems Part2Uploaded bysullivan583
- H01 - Logic CircuitsUploaded bysullivan583
- JAVA - variables.pdfUploaded bysullivan583
- Lesson 1_Code DesignUploaded byLưu Luyến
- PROG0101_CH03Uploaded byBwambale Amos
- Introduction to Programming With XojoUploaded byDhruvin Bhatt
- Sia Ch3(Guidelinesflowchart)Uploaded byroychan
- C chapter part 03Uploaded bySrinidhi Upadhya
- Understand Payroll Wage Type Processing Payroll Schema and Rule Basics DownloadUploaded byశ్రీకాంత్ కొంతం
- Lecture 6 CFP1 Variables Data TypesUploaded byKelly Lulu
- 46536697 Supermarket Billing SystemUploaded byDivz Raj
- cca10Uploaded byroselathika
- 24842705 Seven Quality Tools NewUploaded bymichellebaileylindsa
- AlgorithmUploaded byMuhd Bukhari
- Chap005 Process AnalysisUploaded byShubham Singh
- 4. Requirements AnalysisUploaded byian uzumaki
- OM Process Flow AnalysisUploaded byPinky Mandal
- Accelerated Process ImprovementUploaded byEric Britten

- Revision 03Uploaded bysullivan583
- Revision 06Uploaded bysullivan583
- Revision 05Uploaded bysullivan583
- EffectsUploaded bysullivan583
- MultimediaUploaded bysullivan583
- Revision 08Uploaded bysullivan583
- Quiz 08Uploaded bysullivan583
- Revision 04Uploaded bysullivan583
- Revision 02Uploaded bysullivan583
- Revision 07Uploaded bysullivan583
- P06 - Keyboard EntryUploaded bysullivan583
- P06 - Keyboard EntryUploaded bysullivan583
- Logic CircuitsUploaded bysullivan583
- Quiz 07Uploaded bysullivan583
- Revision 01Uploaded bysullivan583
- Quiz 02Uploaded bysullivan583
- Quiz 06Uploaded bysullivan583
- H04 - NetworksUploaded bysullivan583
- Coding SystemsUploaded bysullivan583
- Coding SystemsUploaded bysullivan583
- Test01- f4Uploaded bysullivan583
- Quiz 03Uploaded bysullivan583
- Quiz 05Uploaded bysullivan583
- Networks (Part 2)Uploaded bysullivan583
- E – MailUploaded bysullivan583
- Quiz 01AUploaded bysullivan583
- Doc 08 4c Docsviewer.googleusercontent.com Viewer Securedownload Hg22m6bbabadtircgichth7rp0cs77jc r3jq8071e9hb0roof2rjisuu45tdoajo 1354616100000 ZXhwbG9yZXI= AGZ5hq LmdrOcX2ScStqFlkDwNKI MEItTUMxTVlkOTNaQVRtcFpMVGMwU25CdFIxVUploaded bysullivan583
- Doc 08 4c Docsviewer.googleusercontent.com Viewer Securedownload Hg22m6bbabadtircgichth7rp0cs77jc r3jq8071e9hb0roof2rjisuu45tdoajo 1354616100000 ZXhwbG9yZXI= AGZ5hq LmdrOcX2ScStqFlkDwNKI MEItTUMxTVlkOTNaQVRtcFpMVGMwU25CdFIxVUploaded bysullivan583
- Data Security and PrivacyUploaded bysullivan583
- Quiz 04Uploaded bysullivan583

- Probability Theory IntroductionUploaded byctn123
- FULLTEXT01.pdfUploaded byAnonymous R7R3oq
- GS HS Math 2012 ParticipantUploaded byhairey947594
- C# Artificial Intelligence (Ai) Programming - A Basic Object Oriented (Oop) Framework for Neural NetworksUploaded byUndibal Alejandro Rivas
- BrachistochroneUploaded bycain_valtierrez
- MODELLING RUBRIC - Linear Programming (Math 3)Uploaded bymakunjap
- Mid Term Exam SolutionsUploaded byIbra Nazla
- mlacapstonepaperUploaded byapi-351533689
- HW 1 Vector ReviewUploaded bybitzels
- Boundary Value ProblemUploaded bySophie Phan
- Aks CodesUploaded byMargit Orsós
- Chap2 Mason RuleUploaded bygoroi90
- 2004 Inquiry Into Children’s Mathematical ThinkingUploaded bynumbersense
- Chapter 4(Differentiation)Uploaded bySahan Siriwardena
- compiled lessonUploaded byapi-386548637
- Parametric Spline Tutorialv2Uploaded byarpitbpatel
- (Clifford, Alan Hooker) Reason, Regulation and Realism.pdfUploaded bychrz90
- 2417738Uploaded byKwao Lazarus
- Drill Perkalian.pdfUploaded bynia
- 20130905170921MTK3013-Chapter1.3 Predicates and QuantifiersUploaded byLurve KimchiLara
- 6th Grade Lesson PlansUploaded byrgjefferson193
- Elliptic Curves and Group LawUploaded byIleana Profeanu
- MINLP synthesis of heat exchanger networks considering pressure drop effects.pdfUploaded bykim haksong
- 01 DAMPING OPTIMIZATION OF PASSIVE AND SEMI-ACTIVE VEHICLE SUSPENSION by numerical simulation.pdfUploaded bygurudev001
- Powerful Forecasting With MS Excel SampleUploaded byHarsa Wara
- Sample chapter from Oxford A Level Mathematics for Edexcel Core C3/C4Uploaded byOxford University Press Children and Schools
- tiffany zhu resumeUploaded byapi-432639294
- hannum observation 2 v1Uploaded byapi-299666154
- Hellmann Feynmann TheoremUploaded byJoshua Smith
- Control System Practice.pdfUploaded byEkansh Dwivedi