SlideShare uma empresa Scribd logo
1 de 15
Core Programming นายสมเกียรติ สอนนวล Cimatt Business Group Co.,LTD.
Core Programming Understand computerstorage and data types Understand computerdecision structures Identify the appropriatemethod for handlingrepetition Understand errorhandling
Understand computer decision structures Lesson Overview Students will understand the decision structures used by computers. In this lesson, you will learn: Various decision structures used in all computer programming languages if decision structures Multiple decision structures such as if…else and switch/Select Case Reading flowcharts Decision tables Evaluating expressions
Understand computer decision structures Review Terms Relational operator Logical operator and, or, not Boolean Expression Condition Value if else ,[object Object]
break
case
Algorithm
Compound statement
Nested statements
Precedence,[object Object]
Understand computer decision structures Relational Expressions A relational operator is used to compare two values, resulting in a relational expression. For example: number > 16 grade == ‘F’ passing >= 60 A list of relational operators: < less than > greater than <= less than or equal to >= greater than or equal to == equal to != not equal to
Understand computer decision structures Logical Operators && and || or ! not
Understand computer decision structures if-else Statement: if (condition) { statement1; } else { 	statement2; }
Understand computer decision structures if-else if Statement: if (condition1) { 	statement1; } else if (condition2) { 	statement2; } else { 	statement3; }
Understand computer decision structures switch Statement: intcaseSwitch = 1; switch (caseSwitch) { case 1: Console.WriteLine("Case 1"); break; case 2: Console.WriteLine("Case 2"); break; default: Console.WriteLine("Default case"); break; }

Mais conteúdo relacionado

Último

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Último (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Destaque (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

1.2 core programming [understand computer decision structures]

  • 1. Core Programming นายสมเกียรติ สอนนวล Cimatt Business Group Co.,LTD.
  • 2. Core Programming Understand computerstorage and data types Understand computerdecision structures Identify the appropriatemethod for handlingrepetition Understand errorhandling
  • 3. Understand computer decision structures Lesson Overview Students will understand the decision structures used by computers. In this lesson, you will learn: Various decision structures used in all computer programming languages if decision structures Multiple decision structures such as if…else and switch/Select Case Reading flowcharts Decision tables Evaluating expressions
  • 4.
  • 10.
  • 11. Understand computer decision structures Relational Expressions A relational operator is used to compare two values, resulting in a relational expression. For example: number > 16 grade == ‘F’ passing >= 60 A list of relational operators: < less than > greater than <= less than or equal to >= greater than or equal to == equal to != not equal to
  • 12. Understand computer decision structures Logical Operators && and || or ! not
  • 13. Understand computer decision structures if-else Statement: if (condition) { statement1; } else { statement2; }
  • 14. Understand computer decision structures if-else if Statement: if (condition1) { statement1; } else if (condition2) { statement2; } else { statement3; }
  • 15. Understand computer decision structures switch Statement: intcaseSwitch = 1; switch (caseSwitch) { case 1: Console.WriteLine("Case 1"); break; case 2: Console.WriteLine("Case 2"); break; default: Console.WriteLine("Default case"); break; }
  • 16. Understand computer decision structures Decision Table A concise way of demonstrating logic Creates an association between conditions and actions to execute
  • 17. Assignment 1 boolisFun = F; boolisKind = F; boolisPopular = T; if isFun && isKind || isPopular; Console.WriteLine("You are my friend."); else Console.WriteLine("Who are you?");
  • 18. Answer 1 boolisFun = false; boolisKind = false; boolisPopular = true; if (isFun && isKind || isPopular) Console.WriteLine("You are my friend."); else Console.WriteLine("Who are you?");
  • 19. Assignment 2 1. You set the high score in Donkey Kong if your score is over 1,050,200 points. if (score > 1050200) 2. Patrick wants to buy a shirt. He will buy the shirt if the shirt's coolness rating is above a 5 out of 10 and the cost is $25 or less. if ________________________________________________________ 3. Morgan has different criteria for buying a shirt. The shirt must have at least 3 buttons and cost less than $50. if ________________________________________________________ 4. Melissa is deciding whether to date Jarid. She will go out with him if he combed his hair or if he doesn’t smell. if ________________________________________________________ 5. Jill has three criteria for deciding whether someone can be her friend. The person can be fun and kind… or they can just be rich. if ________________________________________________________
  • 20. Answer 2 1. You set the high score in Donkey Kong if your score is over 1,050,200 points. if(score > 1050200) 2. Patrick wants to buy a shirt. He will buy the shirt if the shirt's coolness rating is above a 5 out of 10 and the cost is $25 or less. if((coolness > 5) && (cost<=25)) 3. Morgan has different criteria for buying a shirt. The shirt must have at least 3 buttons and cost less than $50. if((buttons>=3) && (cost < 50)) 4. Melissa is deciding whether to date Jarid. She will go out with him if he combed his hair or if he doesn’t smell. if(combed || smell) 5. Jill has three criteria for deciding whether someone can be her friend. The person can be fun and kind… or they can just be rich. if((fun && kind) || rich)