SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Computer Problem Solving
Concepts
Problem solving with computers
Computers use algorithmic solutions
• Program – set of instructions that make up solution to a problem
• Results – outcome of running the program
• Testing – Are the outcomes what you expected and correct
• Documentation – two types
– manual documentation – instructions telling users how to use the
program
Problem solving with computers involves several steps
Clearly define the problem.
• Analyse the problem and formulate a method to solve it (see also
.validation.).
• Describe the solution in the form of an algorithm.
• Draw a flowchart of the algorithm.
• Write the computer program.
• Compile and run the program (debugging).
• Test the program (debugging) (see also verification.).
• Interpretation of results.
Problem solving concepts for computers
• Constants
• Variables
• Operators
• Hierarchy of operations
• Data types
• Equations
• Functions
• Expressions
Variable: a named location in memory for
storing data.
• Variables are values that can change as
much as needed during the execution of a
program. Ex:city=“Mayaguez”
Constant:
• A variable whose value is determined when a program
description is written and doesn’t change from that value
during program execution.
• A constant is a value in a program, that stays the same
throughout the program's execution-numeric, alphabetical,
special symbols. Ex:PI=3.142857
Rules:
Constant cannot be changed after it is initially given a value
Names... Example
CANNOT start with a number 2i
CAN contain a number elsewhere h2o
CANNOT contain any arithmetic operators... r*s+t
CANNOT contain any other punctuation
marks...
#@x%£!!a
CAN contain or begin with an underscore _height_
CANNOT be a languaje keyword else
CANNOT contain a space im smart
CAN be of mixed cases XSquared
Rules:
O
U
T
P
U
T
InformationData
P
R
O
C
E
S
S
Data vs. Information
I
N
P
U
T
Unorganized facts Processed
meaningful
report
Data types and their data sets
Data type Dataset Examples
Numeric:integer All whole numbers 8765,-98
Numeric:Real All real
numbers(whole +
decimal)
3786.98,0.0087
Character(surrounded
by quotation marks)
All letters, numerals
and special symbols
“a”, ”A”, “=“,”5”, “$”
String(Surr. By quote
marks)
Combinations of more
than one character
“art”,”5678”,”01-345-
456778”
Logical True/false True, False
Operators
• Operators are symbols that indicate some kind of action is to be
performed.
• Data connectors within expressions and equations
• Tell the computer how to process the data
• What type of processing needs to be done
• OPERANDS- data that the operator connects and processes
• RESULTANT-answer of the operation.
• - Subtraction
• + Addition
• * Multiplication
• / Division
•  (returns the integer quotient of a division)
• Mod (Divides two numbers and returns only the remainder)
• ^ Power
3 – 2 =1
3 + 2 =5
6 / 3 =2
3 * 2 =6
14  4=3
2 ^ 2 =4
& The concatenate operator (eg. "A" &
"B" gives the result "AB")
Arithmetic Operators
String Operators
14/4=2
Relational Operators
• > Greater than
• < Less than
• >= Greater than or equal
• <= Less than or equal
• = Equal
• <>= Not Equal
Logical Operators
• AND
A && B: result is true iff A and B are true, false otherwise
• OR
A || B: result is false iff A and B are False, true otherwise
• NOT
NOT A: True if A is False
Hierarchy of operations
1. Functions
2. Power
3. Mod
4. *,/
5. +,-
6. =,<,>,<=,>=.<>
7. NOT
8. AND
9. OR
EXPRESSION:
• An expression is a code segment that can be evaluated to
produce a single value.
• Processes the data, the operands through the use of operators.
ex:A + B
EQUATIONS:
• stores the result of an expression in a memory location in the
computer through the = sign. Ex:C=A + B
EXPRESSIONS
Algebraic Computer program
Evaluating Expressions
Calculate the area of the
following figure
x
x
b
x/2
Evaluating Expressions
Area = x2 + x/2 * b
1
2
3
4
4 1: 42 = 16
16
4
3
2
2: 4/2 = 2
3: 2*3 = 6
4: 16 + 6 = 22
6
22
x = 4 and b = 3
Evaluating Expressions

Weitere ähnliche Inhalte

Was ist angesagt?

Working smart with excel v2.0
Working smart with excel v2.0Working smart with excel v2.0
Working smart with excel v2.0
Romy Cagampan
 
Module 5 entering data in worksheet
Module 5 entering data in worksheetModule 5 entering data in worksheet
Module 5 entering data in worksheet
Dr. Shalini Pandey
 

Was ist angesagt? (20)

2016 ms excel_bm
2016 ms excel_bm2016 ms excel_bm
2016 ms excel_bm
 
using excel 2013 as a power user
using excel 2013 as a power userusing excel 2013 as a power user
using excel 2013 as a power user
 
Working smart with excel v2.0
Working smart with excel v2.0Working smart with excel v2.0
Working smart with excel v2.0
 
Ms excel
Ms excelMs excel
Ms excel
 
Basic Formulas - Excel 2013 Tutorial
Basic Formulas - Excel 2013 TutorialBasic Formulas - Excel 2013 Tutorial
Basic Formulas - Excel 2013 Tutorial
 
Excel 2010 training presentation figure out dates by using formulas in exce...
Excel 2010 training presentation   figure out dates by using formulas in exce...Excel 2010 training presentation   figure out dates by using formulas in exce...
Excel 2010 training presentation figure out dates by using formulas in exce...
 
Exel
ExelExel
Exel
 
Chapter.05
Chapter.05Chapter.05
Chapter.05
 
Data Analytics Using MS Excel
Data Analytics Using MS ExcelData Analytics Using MS Excel
Data Analytics Using MS Excel
 
Ms excel 2016_function
Ms excel 2016_functionMs excel 2016_function
Ms excel 2016_function
 
MS-EXCEL Assignment Help
MS-EXCEL Assignment HelpMS-EXCEL Assignment Help
MS-EXCEL Assignment Help
 
20 Unique Uses of Excel Spreadsheets
20 Unique Uses of Excel Spreadsheets20 Unique Uses of Excel Spreadsheets
20 Unique Uses of Excel Spreadsheets
 
Advanced Excel Demo
Advanced Excel DemoAdvanced Excel Demo
Advanced Excel Demo
 
Module 5 entering data in worksheet
Module 5 entering data in worksheetModule 5 entering data in worksheet
Module 5 entering data in worksheet
 
presentationMs excel
presentationMs excelpresentationMs excel
presentationMs excel
 
Ms Excel Basic to Advance Tutorial
Ms Excel Basic to Advance TutorialMs Excel Basic to Advance Tutorial
Ms Excel Basic to Advance Tutorial
 
Guia 1 periodo ii informatica grado 9
Guia 1 periodo ii informatica grado 9Guia 1 periodo ii informatica grado 9
Guia 1 periodo ii informatica grado 9
 
Skillshare - Creating Excel Dashboards
Skillshare - Creating Excel DashboardsSkillshare - Creating Excel Dashboards
Skillshare - Creating Excel Dashboards
 
Simple formulas excel
Simple formulas excelSimple formulas excel
Simple formulas excel
 
Cash flow using excel
Cash flow using excelCash flow using excel
Cash flow using excel
 

Andere mochten auch

Sistema Binario
Sistema BinarioSistema Binario
Sistema Binario
gonzdanie
 

Andere mochten auch (15)

Asignacion 1 para el 9 de febrero
Asignacion 1 para el 9 de febreroAsignacion 1 para el 9 de febrero
Asignacion 1 para el 9 de febrero
 
2 Datos-tema2
2 Datos-tema22 Datos-tema2
2 Datos-tema2
 
3 Conceptos progamacion-tema3
3 Conceptos progamacion-tema33 Conceptos progamacion-tema3
3 Conceptos progamacion-tema3
 
Uso basico de Excel 2013
Uso basico de Excel 2013 Uso basico de Excel 2013
Uso basico de Excel 2013
 
Interprete vs compilador
Interprete vs compiladorInterprete vs compilador
Interprete vs compilador
 
8 errores y depuracion-tema 8
8 errores y depuracion-tema 88 errores y depuracion-tema 8
8 errores y depuracion-tema 8
 
Macros y VBA tema 5
Macros y VBA tema 5Macros y VBA tema 5
Macros y VBA tema 5
 
4 Solving problem
4 Solving problem4 Solving problem
4 Solving problem
 
Asignacion 2
Asignacion 2Asignacion 2
Asignacion 2
 
Sistema Binario
Sistema BinarioSistema Binario
Sistema Binario
 
1 Introduccion-tema1
1 Introduccion-tema11 Introduccion-tema1
1 Introduccion-tema1
 
00 Prontuario inge 3016
00 Prontuario inge 301600 Prontuario inge 3016
00 Prontuario inge 3016
 
Diferentes formas input_output
Diferentes formas input_outputDiferentes formas input_output
Diferentes formas input_output
 
Areas por coordenadas
Areas por coordenadasAreas por coordenadas
Areas por coordenadas
 
Asignacion 3 algoritmos secuenciales
Asignacion 3 algoritmos secuencialesAsignacion 3 algoritmos secuenciales
Asignacion 3 algoritmos secuenciales
 

Ähnlich wie 5 conceptos progamacion2-tema4

Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
miansaad18
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
Tony Apreku
 

Ähnlich wie 5 conceptos progamacion2-tema4 (20)

Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 ppt
 
c-programming
c-programmingc-programming
c-programming
 
C++.pptx
C++.pptxC++.pptx
C++.pptx
 
Programming
ProgrammingProgramming
Programming
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
lec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.pptlec_4_data_structures_and_algorithm_analysis.ppt
lec_4_data_structures_and_algorithm_analysis.ppt
 
C program
C programC program
C program
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
Basics of c++ Programming Language
Basics of c++ Programming LanguageBasics of c++ Programming Language
Basics of c++ Programming Language
 
Basic elements of java
Basic elements of java Basic elements of java
Basic elements of java
 
8.unit-1-fds-2022-23.pptx
8.unit-1-fds-2022-23.pptx8.unit-1-fds-2022-23.pptx
8.unit-1-fds-2022-23.pptx
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
 
Object oriented programming 8 basics of c++ programming
Object oriented programming 8 basics of c++ programmingObject oriented programming 8 basics of c++ programming
Object oriented programming 8 basics of c++ programming
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptx
 
What is algorithm
What is algorithmWhat is algorithm
What is algorithm
 
Flowcharting and Algorithm
Flowcharting and Algorithm Flowcharting and Algorithm
Flowcharting and Algorithm
 
Programming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptxProgramming in C by SONU KUMAR.pptx
Programming in C by SONU KUMAR.pptx
 
C programming language
C programming languageC programming language
C programming language
 
Unit 1 Introduction Part 3.pptx
Unit 1 Introduction Part 3.pptxUnit 1 Introduction Part 3.pptx
Unit 1 Introduction Part 3.pptx
 

Mehr von Elba Sepúlveda

Mehr von Elba Sepúlveda (16)

Consideraciones sobre etica y plagio en tiempos de internet e sepulveda
Consideraciones sobre etica  y plagio en tiempos de internet e sepulvedaConsideraciones sobre etica  y plagio en tiempos de internet e sepulveda
Consideraciones sobre etica y plagio en tiempos de internet e sepulveda
 
Invitación a actos de graduación r2 deep clase 2017
Invitación a actos de graduación r2 deep clase 2017Invitación a actos de graduación r2 deep clase 2017
Invitación a actos de graduación r2 deep clase 2017
 
12 estructuras de repeticion2-tema12
12 estructuras de repeticion2-tema1212 estructuras de repeticion2-tema12
12 estructuras de repeticion2-tema12
 
13 arreglos -tema13
13 arreglos -tema1313 arreglos -tema13
13 arreglos -tema13
 
11 estructuras de repeticion-tema11
11 estructuras de repeticion-tema1111 estructuras de repeticion-tema11
11 estructuras de repeticion-tema11
 
10 estructuras de seleccion select case i-tema10
10 estructuras de seleccion select case i-tema1010 estructuras de seleccion select case i-tema10
10 estructuras de seleccion select case i-tema10
 
9 estructuras de seleccion o de decision i-tema9
9 estructuras de seleccion o de decision i-tema99 estructuras de seleccion o de decision i-tema9
9 estructuras de seleccion o de decision i-tema9
 
Newsletter
NewsletterNewsletter
Newsletter
 
Asignacion 4 algoritmos de seleccion
Asignacion 4 algoritmos de seleccionAsignacion 4 algoritmos de seleccion
Asignacion 4 algoritmos de seleccion
 
Estructuras de seleccion o de decision i-tema9
Estructuras de seleccion o de decision i-tema9Estructuras de seleccion o de decision i-tema9
Estructuras de seleccion o de decision i-tema9
 
Categorias
CategoriasCategorias
Categorias
 
Metodologia de la investigacion
Metodologia de la investigacionMetodologia de la investigacion
Metodologia de la investigacion
 
Revision de literatura
Revision de literaturaRevision de literatura
Revision de literatura
 
Procesadores de palabras
Procesadores de palabrasProcesadores de palabras
Procesadores de palabras
 
Repaso del movimiento de proyectiles
Repaso del movimiento de proyectilesRepaso del movimiento de proyectiles
Repaso del movimiento de proyectiles
 
Discusion laboratorio proyectiles
Discusion laboratorio proyectilesDiscusion laboratorio proyectiles
Discusion laboratorio proyectiles
 

Kürzlich hochgeladen

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 

Kürzlich hochgeladen (20)

Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 

5 conceptos progamacion2-tema4

  • 2. Problem solving with computers Computers use algorithmic solutions • Program – set of instructions that make up solution to a problem • Results – outcome of running the program • Testing – Are the outcomes what you expected and correct • Documentation – two types – manual documentation – instructions telling users how to use the program
  • 3. Problem solving with computers involves several steps Clearly define the problem. • Analyse the problem and formulate a method to solve it (see also .validation.). • Describe the solution in the form of an algorithm. • Draw a flowchart of the algorithm. • Write the computer program. • Compile and run the program (debugging). • Test the program (debugging) (see also verification.). • Interpretation of results.
  • 4. Problem solving concepts for computers • Constants • Variables • Operators • Hierarchy of operations • Data types • Equations • Functions • Expressions
  • 5. Variable: a named location in memory for storing data. • Variables are values that can change as much as needed during the execution of a program. Ex:city=“Mayaguez”
  • 6. Constant: • A variable whose value is determined when a program description is written and doesn’t change from that value during program execution. • A constant is a value in a program, that stays the same throughout the program's execution-numeric, alphabetical, special symbols. Ex:PI=3.142857 Rules: Constant cannot be changed after it is initially given a value
  • 7. Names... Example CANNOT start with a number 2i CAN contain a number elsewhere h2o CANNOT contain any arithmetic operators... r*s+t CANNOT contain any other punctuation marks... #@x%£!!a CAN contain or begin with an underscore _height_ CANNOT be a languaje keyword else CANNOT contain a space im smart CAN be of mixed cases XSquared Rules:
  • 9. Data types and their data sets Data type Dataset Examples Numeric:integer All whole numbers 8765,-98 Numeric:Real All real numbers(whole + decimal) 3786.98,0.0087 Character(surrounded by quotation marks) All letters, numerals and special symbols “a”, ”A”, “=“,”5”, “$” String(Surr. By quote marks) Combinations of more than one character “art”,”5678”,”01-345- 456778” Logical True/false True, False
  • 10. Operators • Operators are symbols that indicate some kind of action is to be performed. • Data connectors within expressions and equations • Tell the computer how to process the data • What type of processing needs to be done • OPERANDS- data that the operator connects and processes • RESULTANT-answer of the operation.
  • 11. • - Subtraction • + Addition • * Multiplication • / Division • (returns the integer quotient of a division) • Mod (Divides two numbers and returns only the remainder) • ^ Power 3 – 2 =1 3 + 2 =5 6 / 3 =2 3 * 2 =6 14 4=3 2 ^ 2 =4 & The concatenate operator (eg. "A" & "B" gives the result "AB") Arithmetic Operators String Operators 14/4=2
  • 12. Relational Operators • > Greater than • < Less than • >= Greater than or equal • <= Less than or equal • = Equal • <>= Not Equal
  • 13. Logical Operators • AND A && B: result is true iff A and B are true, false otherwise
  • 14. • OR A || B: result is false iff A and B are False, true otherwise
  • 15. • NOT NOT A: True if A is False
  • 16. Hierarchy of operations 1. Functions 2. Power 3. Mod 4. *,/ 5. +,- 6. =,<,>,<=,>=.<> 7. NOT 8. AND 9. OR
  • 17. EXPRESSION: • An expression is a code segment that can be evaluated to produce a single value. • Processes the data, the operands through the use of operators. ex:A + B EQUATIONS: • stores the result of an expression in a memory location in the computer through the = sign. Ex:C=A + B
  • 19. Evaluating Expressions Calculate the area of the following figure x x b x/2
  • 20. Evaluating Expressions Area = x2 + x/2 * b 1 2 3 4 4 1: 42 = 16 16 4 3 2 2: 4/2 = 2 3: 2*3 = 6 4: 16 + 6 = 22 6 22 x = 4 and b = 3