[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-668973-105":3,"detail-sidebar-cat-0-en-105":81,"doc-detail-668973-en":130,"doc-similar-668973":161},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":74,"head_meta":76,"extra_data":78,"updated_unix":80},105,"en","branching-determine-the-nature-of-a-condition","Branching - Determine the Nature of a Condition","","Branching explains how computer programs execute different statements depending on whether conditions evaluate to True or False. The material defines conditions, Boolean expressions, comparison operators, and logical operators, then shows how decision structures control program flow. It introduces flowcharting as a language-independent way to depict logic using symbols such as rectangles and parallelograms. It also distinguishes single-alternative, dual-alternative, and multi-alternative decision structures, including examples for time-based and sales-based logic.",{"@graph":14,"@context":73},[15,34,56],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/branching-determine-the-nature-of-a-condition/668973/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/branching-determine-the-nature-of-a-condition/668973.png","ImageObject",300,407,{"name":42,"@type":43},"Alex Sinclair","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-12-02","2026-11-01",true,{"@type":52,"interactionType":53,"userInteractionCount":55},"InteractionCounter",{"@type":54},"ViewAction",5,{"@type":57,"mainEntity":58},"FAQPage",[59,65,69],{"name":60,"@type":61,"acceptedAnswer":62},"What is a condition in a computer program?","Question",{"text":63,"@type":64},"A condition is an expression that evaluates to True or False. Different instructions execute depending on the result.","Answer",{"name":66,"@type":61,"acceptedAnswer":67},"How do flowcharts help with branching logic?",{"text":68,"@type":64},"Flowcharts depict program logic using shapes and symbols and are language independent. Translating a finalized flowchart into code helps implement the branching behavior correctly.",{"name":70,"@type":61,"acceptedAnswer":71},"What are the three types of decision structures described?",{"text":72,"@type":64},"The lesson discusses single alternative, dual alternative, and multi-alternative decision structures, each using conditions to select among different execution paths.","https://schema.org",{"og:url":32,"og:type":75,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":77,"canonical":32},"index,follow",{"doc_id":79,"site_id":7},668973,1793521911,{"code":4,"msg":82,"data":83},"success",[84,88,92,96,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":85,"show_sort_weight":86,"slug":87},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":89,"show_sort_weight":90,"slug":91},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":93,"show_sort_weight":94,"slug":95},"Exam",70,"exam",{"id":55,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":55,"slug":129},19,"General","general",{"code":4,"msg":82,"data":131},{"doc_id":79,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":55,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":80,"read_time":107,"preview_page_count":33,"preview_urls":144},1099523882182,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","Branching  \nCOMPUTER PROGRAMS contain statements that need  \nto be executed under certain circumstances. A  \nprogram may contain code to display “Winter”,“Spring”,“Summer”, or “Fall” depending upon the current date’s month. In order to do so, it must ask questions and display text depending upon the answer to the question. Asking  \nquestions in a computer program and executing code based upon the answer is achieved by developing and coding branching or decision statements in the program.  \nObjective:  \n 􀀂  Determine the nature of a condition, explain Boolean logic, and use branching statements  \nKey Terms:  \n􀀂 Boolean expression  \nComparison operators Condition  \nDecision Structure Dual alternative decision  \nstructure  \nFlowcharts Logical operators Multi-alternative  \ndecision structure Nested Decision  \nstructure  \nPseudocode  \nSingle alternative decision structure  \nBranching   \nComputer programs contain numerous decision structures. For example, a program may contain code to display “Good morning” when the time [is between 8 A.M. and 11:59 A.M. in](is between 8 A.M. and 11:59 A.M. in)  \n[the morning and](the morning and) “[Good evening](Good evening)” [when time is between 12:00 P.M](when time is between 12:00 P.M). and 11:59 P.M. This logic  \nis accomplished in a computer program using branching (or decision) statements, where each branch executes a different set of code. This lesson examines the process of coding statements that evaluate decision statements and implement branching logic in computer programs.  \nE-unit: Branching  \nPage 1 􀀂 [www.MyCAERT.com](www.MyCAERT.com)  \nCopyright © by CAERT, Inc.— Reproduction by subscription only. 780027  \nDETERMINE THE NATURE OF A CONDITION  \nIn a computer program, not all statements are executed each time the program runs. Certain statements only execute when a specific condition is met. This section discusses constructing conditions and their effect of program logic.  \nUsing Flowcharts  \nDeveloping code is a complex venture. It requires knowledge of the programming language used to create the program, and an understanding of the logic to be implemented in code. Therefore, early in the days of programming, a system of depicting logic using symbols called Flowcharting gained prevalence. Flowcharts depict logic using symbols and shapes and are language independent. Since they are graphical, it is easier to understand program logic than it is to read code. Flowcharts, is a sense, are a language all by themselves with different shapes used to represent different operations. Flowcharts are developed before writing code. Once logic fora problem has been finalized, the flowchart is translated into a programming language. See FIGURE 1 for some of the commonly used flowcharting symbols. For example, a rectangle is used to depict variable declaration and computations, and a parallelogram is used to represent input and output operations. In some schools offlowcharting, declaration statements are shown with lines inside. When a program needs to display a message to the user, the text inside the parallelogram can say “Print” or “Display. The action is better represented by the “Display”, but “Print” is used even though it sounds like an action to print on a printer. This is because languages, such as Python, use a command called “print” to display messages to the user. This lesson uses “Display” as the action instead of“Print”.  \nFIGURE 1. Flowchart symbols.  \nE-unit: Branching  \nPage 2 􀀂 [www.MyCAERT.com](www.MyCAERT.com)  \nCopyright © by CAERT, Inc.— Reproduction by subscription only. 780027  \n\n| Conditions and Decision Structures\u003Cbr>A Condition is an expression in a program that evaluates to a True or a False. Different sets of instructions execute when a condition returns a value of True or a False. FIGURE 2 shows examples of conditions that a program may need to handle. Conditional logic is implemented\u003Cbr>\u003Cbr>FIGURE 2. Conditions in a computer program. |  |\n| --- | --- |\n| in a programmi","cbCaigszlH9xa9y7","https://ap.wps.com/l/cbCaigszlH9xa9y7","pdf",1349933,16,"English","# Determine the Nature of a Condition\n## Using Flowcharts\n## Conditions and Decision Structures\n## Types of Decision Structures","[{\"question\":\"What is a condition in a computer program?\",\"answer\":\"A condition is an expression that evaluates to True or False. Different instructions execute depending on the result.\"},{\"question\":\"How do flowcharts help with branching logic?\",\"answer\":\"Flowcharts depict program logic using shapes and symbols and are language independent. Translating a finalized flowchart into code helps implement the branching behavior correctly.\"},{\"question\":\"What are the three types of decision structures described?\",\"answer\":\"The lesson discusses single alternative, dual alternative, and multi-alternative decision structures, each using conditions to select among different execution paths.\"}]","Branching - Determine the Nature of a Condition | PDF",[145,149,153,157],{"page_no":22,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/30d8184e87b29d613cbcc2af08281140.webp",983,1272,{"page_no":26,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/e9cb4ec1e2830768e78bd17216b916a0.webp",982,1270,{"page_no":30,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/15b9452a7e464979f7188ce5452153cc.webp",981,1269,{"page_no":33,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/d69d48d43e18ac3d67163b57bf5ade08.webp",980,1268,{"list":162,"token":11},[163,169,175,182,189,195,202,208,214,220],{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":33,"category_name":29,"create_tm":168},697704,"Introduction to Programming in C++ - Algorithms, Flowcharts and Pseudocode","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230009856755/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=RBxzcsSygRHs%2FZbq9dhH4QU52d8%3D","introduction-to-programming-in-c-algorithms-flowcharts-and-pseudocode",1794442290,{"doc_id":170,"doc_title":171,"file_type":137,"home_preview_img_url":172,"slug":173,"view_count":115,"category_name":29,"create_tm":174},655467,"Logic Circuits - Definition of Logic Gates - AND, OR, NOT Gates","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229974773816/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=GOdlZ7lHv5l%2FFpy6XQ6BNfhSTpU%3D","logic-circuits-definition-of-logic-gates-and-or-not-gates",1792961914,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":180,"category_name":29,"create_tm":181},347398,"PROGRAMMING IN “C” - MCA 101 - Lecture Notes","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911501616/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=DjhKccsIXr10clxbtCy8COL82Ok%3D","programming-in-c-mca-101-lecture-notes",34,1790066783,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":187,"category_name":29,"create_tm":188},390029,"Google Search Operators Cheat Sheet - Part 1 - reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229917161219/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=FHAUwLIFADWIQieU1qPPh%2F5Y7rc%3D","google-search-operators-cheat-sheet-part-1-reference",14,1790329258,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":33,"category_name":29,"create_tm":194},673425,"Pseudocode & Flow Charts - read online free","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229990822783/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=H5IAdnk7lNHamFs%2FWq4hLd2dxc0%3D","pseudocode-flow-charts-read-online-free",1793637913,{"doc_id":196,"doc_title":197,"file_type":137,"home_preview_img_url":198,"slug":199,"view_count":200,"category_name":29,"create_tm":201},655545,"Chapter 9 - Discrete Control Using Programmable Logic Controllers","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975284838/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=cKw3e1F2sDQ8TMftjq9E9%2FQpgsY%3D","chapter-9-discrete-control-using-programmable-logic-controllers",13,1792962539,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":110,"category_name":29,"create_tm":207},655478,"Basic Logic Gates in Digital Electronics - What are Basic Logic Gates, Basic and Derived Logic Gates, Derived Logic Gates, and Differences","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975082926/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=R1WsbAJi8tCACyhzT00GG4S%2BYL8%3D","basic-logic-gates-in-digital-electronics-what-are-basic-logic-gates-basic-and-derived-logic-gates-derived-logic-gates-and-differences",1792961954,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":101,"category_name":29,"create_tm":213},669239,"Flowcharts - KIPR Module 2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988184850/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=r2sm6boa2li7X%2FodrSyYmAiASb4%3D","flowcharts-kipr-module-2",1793536948,{"doc_id":215,"doc_title":216,"file_type":137,"home_preview_img_url":217,"slug":218,"view_count":55,"category_name":29,"create_tm":219},682215,"Integers and floats - Python programming style guidance","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998448523/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=UsZm4kVgu1HsvyGpLPijhRdKSEQ%3D","integers-and-floats-python-programming-style-guidance",1793963004,{"doc_id":221,"doc_title":222,"file_type":137,"home_preview_img_url":223,"slug":224,"view_count":101,"category_name":29,"create_tm":225},681054,"SN7400N - Quad 2-Input Positive NAND Gate - Datasheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998602576/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796211539&Signature=SZ2yeJHdBJ%2F1IF82ccBj7%2BxViwI%3D","sn7400n-quad-2-input-positive-nand-gate-datasheet",1793938284]