The document discusses programming concepts including switch case statements, looping, and different types of loops like for, while, and do-while loops. It provides examples of how to write switch case statements to select different code blocks based on a variable's value. It also explains the different parts of for, while, and do-while loops and provides examples of each type of loop. Several short programs are included that demonstrate using loops and switch case statements to process user input and perform calculations.
The document discusses programming languages and different types of loops used in programming. It defines programming as using a computer language to develop applications and scripts for a computer to execute. It then describes the different types of loops - for loops, which allow initialization of a variable, checking a condition, and updating the variable; while loops, which repeat code while a condition is true; and do-while loops, which execute code at least once before checking the condition. Examples of each loop type are provided to illustrate their usage.
Programming languages allow programmers to develop computer programs and software by providing instructions to computers. They provide a framework for organizing ideas about processes and tasks. Programming is a broad field that involves writing scripts, applications, and programs using various programming languages. Common programming languages include C++ and DEV C++. Programming uses concepts like variables, data types, functions, and control structures like loops and conditional statements to manipulate data and develop programs.
Programming involves using computer languages to develop applications, scripts, or other instructions for computers. It is a creative process where programmers instruct computers on tasks through programming languages. There are many programming languages available, with some of the most common being C++ and Dev C++. Programming can involve various structures like switch statements and loops to control program flow and repetition.
The document discusses programming concepts like switch case statements and looping. It defines programming as using a computer language to develop applications and scripts. It explains that switch case statements can be used as an alternative to long if statements to compare a variable to integral values. The basic format of a switch case is provided. It also discusses the different types of loops - for, while, and do-while loops. Examples are given to illustrate how each type of loop works.
Switch case statements provide an alternative to long if/else statements when comparing a variable to multiple integral values. The basic format compares the variable to case values, executing code for a matching case. A default case handles non-matching values. Loops allow code to repeat, with for, while, and do-while loops. For loops initialize/update a variable and check a condition each repetition. While loops check a condition and repeat until it's false. Loops are useful for repeating tasks like displaying lists of data.
The document discusses programming concepts including programming languages, switch case statements, and looping. It provides examples of how to write code using switch case statements and different types of loops (for, while, do-while). The examples demonstrate how to get user input, perform calculations, and repeat blocks of code multiple times.
The document discusses switch case statements and looping in programming. It provides examples of switch case statements that allow a program to execute different code depending on the value of a variable. It also discusses the three main types of loops - for, while, and do while loops - and provides examples of how to write each type of loop. The document is intended to help explain switch case statements and looping to programmers.
The document discusses programming languages and different types of loops in programming. It provides examples of for, while, and do-while loops. A for loop initializes a variable, specifies a condition, and updates the variable on each iteration. A while loop runs code while a condition is true. A do-while loop runs code once then checks the condition on subsequent iterations. Loops allow code to repeat to produce greater results through repetition.
The document discusses programming languages and different types of loops used in programming. It defines programming as using a computer language to develop applications and scripts for a computer to execute. It then describes the different types of loops - for loops, which allow initialization of a variable, checking a condition, and updating the variable; while loops, which repeat code while a condition is true; and do-while loops, which execute code at least once before checking the condition. Examples of each loop type are provided to illustrate their usage.
Programming languages allow programmers to develop computer programs and software by providing instructions to computers. They provide a framework for organizing ideas about processes and tasks. Programming is a broad field that involves writing scripts, applications, and programs using various programming languages. Common programming languages include C++ and DEV C++. Programming uses concepts like variables, data types, functions, and control structures like loops and conditional statements to manipulate data and develop programs.
Programming involves using computer languages to develop applications, scripts, or other instructions for computers. It is a creative process where programmers instruct computers on tasks through programming languages. There are many programming languages available, with some of the most common being C++ and Dev C++. Programming can involve various structures like switch statements and loops to control program flow and repetition.
The document discusses programming concepts like switch case statements and looping. It defines programming as using a computer language to develop applications and scripts. It explains that switch case statements can be used as an alternative to long if statements to compare a variable to integral values. The basic format of a switch case is provided. It also discusses the different types of loops - for, while, and do-while loops. Examples are given to illustrate how each type of loop works.
Switch case statements provide an alternative to long if/else statements when comparing a variable to multiple integral values. The basic format compares the variable to case values, executing code for a matching case. A default case handles non-matching values. Loops allow code to repeat, with for, while, and do-while loops. For loops initialize/update a variable and check a condition each repetition. While loops check a condition and repeat until it's false. Loops are useful for repeating tasks like displaying lists of data.
The document discusses programming concepts including programming languages, switch case statements, and looping. It provides examples of how to write code using switch case statements and different types of loops (for, while, do-while). The examples demonstrate how to get user input, perform calculations, and repeat blocks of code multiple times.
The document discusses switch case statements and looping in programming. It provides examples of switch case statements that allow a program to execute different code depending on the value of a variable. It also discusses the three main types of loops - for, while, and do while loops - and provides examples of how to write each type of loop. The document is intended to help explain switch case statements and looping to programmers.
The document discusses programming languages and different types of loops in programming. It provides examples of for, while, and do-while loops. A for loop initializes a variable, specifies a condition, and updates the variable on each iteration. A while loop runs code while a condition is true. A do-while loop runs code once then checks the condition on subsequent iterations. Loops allow code to repeat to produce greater results through repetition.
This document discusses different types of loops in C++ programming including for loops, while loops, do-while loops, and infinite loops. It provides examples of each loop type and explanations of how they work. It also covers switch-case statements, providing an example case statement that prints different outputs depending on the user's input number.
1) The document provides an introduction to programming concepts like flow charts, libraries, variables, data types, inputs/outputs, and operators.
2) Control structures like if/else, switch, and different types of loops (for, while, do-while) are explained with examples.
3) An assignment is given to write a calculator program that takes two numbers from the user, an operation to perform, performs the calculation, and allows the user to choose another operation or exit.
The document discusses looping statements in programming which allow a block of code to be repeatedly executed until a certain condition is reached. There are three main types of loops: for loops, while loops, and do-while loops. For loops initialize a variable, specify a condition, and update the variable each iteration. While loops continuously execute the code block as long as the condition is true. Do-while loops are similar to while loops but execute the code block at least once even if the condition is false.
CPAP.com Introduction To Coding: Part 2johnnygoodman
This document provides an introduction to PHP and database interaction using PHP. It begins with an overview of PHP syntax including variables, data types, comments, and basic control structures like if/else statements and for loops. It then demonstrates how to connect to a database and execute SQL queries to retrieve and display data. An example shows connecting to a database, selecting all rows from a table ordered by name, then looping through the results to output each restaurant name along with whether it is gluten free or not. The document aims to explain the basic logic and concepts of PHP that can be applied to any language.
170120107074 looping statements and nesting of loop statementsharsh kothari
Looping in programming involves repeatedly executing a block of code until a certain condition is met. There are three main types of loops in C: for, while, and do-while. For and while loops check the loop condition at the beginning of each iteration, while do-while checks at the end. Loops are useful for tasks like printing something many times without copying/pasting code. Looping can also be nested, with one loop placed inside another, to create more complex programs.
Final project powerpoint template (fndprg) (1)jewelyngrace
The document discusses various programming topics including looping, switch case statements, and different types of loops in C++ programming such as for, while, and do while loops. Examples of each loop type are provided written in C++ code.
Final requirement in programming niperosmarkings17
Here is an example of a basic for loop in C++:
for (int i = 0; i < 10; i++) {
cout << i << endl;
}
This loop will print the numbers 0 through 9. It initializes the variable i to 0, checks that i is less than 10 for the condition, and increments i by 1 each iteration via i++.
Final requirement in programming vinsonmonstergeorge
Here are the key steps in a for loop:
1. Initialize a counter variable (often i) to track the number of iterations
2. Define a condition to check on each iteration (often i < 10)
3. Increment/decrement the counter variable after each iteration (often i++)
4. The code block inside the for loop will repeat until the condition is no longer true
So in summary, a for loop allows you to repeat a block of code a specific number of times by initializing/updating a counter variable and checking its value on each iteration.
Looping statements in PHP include the while, do-while, for, and foreach loops. The while loop checks the condition first before iterating, while the do-while loop checks after iterating. The for loop is used when the number of iterations is known in advance. It initializes, checks a condition, and increments between iterations. The foreach loop iterates over arrays, allowing access to both values and keys. The break statement exits the current loop, while continue skips to the next iteration.
This document discusses different types of loops in C++ programming including for loops, while loops, do-while loops, and infinite loops. It provides examples of each loop type and explanations of how they work. It also covers switch-case statements, providing an example case statement that prints different outputs depending on the user's input number.
Switch statements and looping statements are key programming concepts. Switch statements allow a program to evaluate an expression and branch to different blocks of code based on the resulting value. Common switch statements include if/else. Looping statements let a program repeat blocks of code a specified number of times or while a condition remains true. Common looping statements include while, do/while, and for loops. Together, switch and looping statements allow programs to selectively execute code and repeat tasks as needed to process inputs and achieve the desired output.
Powerpoint presentation final requirement in fnd prgalyssa-castro2326
The document provides examples of switch case statements in C++ programming. The first example displays different functions based on the number input by the user. The second example displays different messages depending on the number between 1-6 entered by the user. The third example displays messages based on the letter 'a', 'b', or 'c' chosen by the user. All examples use a switch case statement to direct program flow and output based on the user's input variable.
Final project powerpoint template (fndprg) (1)heoff
The switch statement compares the value of an expression to a list of integer or character constants. For each matching case, the statements within that case will be executed until a break statement is reached. If no cases match, the default statements will be executed. The switch statement provides an alternative to multiple if/else if statements for selecting between multiple options.
Iterative structures, also known as loops, repeat sections of code and are used for tasks like calculating multiple values, computing iterative results, printing tables of data, and processing large amounts of input or array data. The three types of loops in C++ are the while loop, do-while loop, and for loop, each with different test conditions to control the loop execution. Loops can also be nested within each other to perform multiple iterations or to loop through multi-dimensional data structures.
The document discusses switch case statements in programming. It provides details on the basic format and usage of switch case statements, including that they allow a variable to be tested for equality against multiple values through different cases. The document also notes some key rules for switch cases, such as requiring a break statement at the end of each case and that case values must be integer or character constants. It provides examples of switch case statements and discusses how they can provide a cleaner alternative to long if-else statements.
VBScript is a lightweight scripting language that can be used for both client-side and server-side programming. It is a light version of Visual Basic. VBScript supports variables, arrays, procedures, functions, conditional statements like If-Else and Select Case, and loops like For Each, Do While, and Do Until loops. Built-in functions provide date, time, and mathematical capabilities.
Loop control statements in C are used to repeatedly execute a block of code while or until a given condition is true. There are three main types of loop control statements in C: for, while, and do-while loops. The for loop allows executing a block of code a specific number of times. The while loop repeatedly executes the block as long as the condition is true. The do-while loop is similar to the while loop, but it will always execute the block at least once even if the condition is false.
C lecture 4 nested loops and jumping statements slideshareGagan Deep
Nested Loops and Jumping Statements(Loop Control Statements), Goto statement in C, Return Statement in C Exit statement in C, For Loops with Nested Loops, While Loop with Nested Loop, Do-While Loop with Nested Loops, Break Statement, Continue Statement : visit us at : www.rozyph.com
The document discusses different types of loops in C++ including while, do-while, for, and switch-case statements. It provides examples of using each loop or statement to repeat operations a certain number of times or while a condition is met. Key examples include a countdown loop using while, calculating factorials with for, and a calculator program using switch-case to perform math operations.
Of complicacy of programming, or won't C# save us?PVS-Studio
Programming is hard. I hope no one would argue that. But the topic of new programming languages, or more exactly, search of a "silver bullet" is always highly popular with software developers. The most "trendy" topic currently is superiority of one programming language over the other. For instance, C# is "cooler" than C++. Although holy wars are not the reason why I'm writing this post, still it is a "sore subject" for me. Oh, come on, C#/lisp/F#/Haskell/... won't let you write a smart application that would interact with the outer world and that's all. All the elegance will disappear as soon as you decide to write some real soft and not a sample "in itself".
This document lists various bridesmaid dress options available for purchase from a UK wedding dress website, including dresses in blue, purple, red, pink, and green colors as well as vintage styles. Specific dresses highlighted include a blue ruched one shoulder dress, blue ruched halter dress, and various purple, vintage, and affordable bridesmaid dress options available through the website.
This document discusses different types of loops in C++ programming including for loops, while loops, do-while loops, and infinite loops. It provides examples of each loop type and explanations of how they work. It also covers switch-case statements, providing an example case statement that prints different outputs depending on the user's input number.
1) The document provides an introduction to programming concepts like flow charts, libraries, variables, data types, inputs/outputs, and operators.
2) Control structures like if/else, switch, and different types of loops (for, while, do-while) are explained with examples.
3) An assignment is given to write a calculator program that takes two numbers from the user, an operation to perform, performs the calculation, and allows the user to choose another operation or exit.
The document discusses looping statements in programming which allow a block of code to be repeatedly executed until a certain condition is reached. There are three main types of loops: for loops, while loops, and do-while loops. For loops initialize a variable, specify a condition, and update the variable each iteration. While loops continuously execute the code block as long as the condition is true. Do-while loops are similar to while loops but execute the code block at least once even if the condition is false.
CPAP.com Introduction To Coding: Part 2johnnygoodman
This document provides an introduction to PHP and database interaction using PHP. It begins with an overview of PHP syntax including variables, data types, comments, and basic control structures like if/else statements and for loops. It then demonstrates how to connect to a database and execute SQL queries to retrieve and display data. An example shows connecting to a database, selecting all rows from a table ordered by name, then looping through the results to output each restaurant name along with whether it is gluten free or not. The document aims to explain the basic logic and concepts of PHP that can be applied to any language.
170120107074 looping statements and nesting of loop statementsharsh kothari
Looping in programming involves repeatedly executing a block of code until a certain condition is met. There are three main types of loops in C: for, while, and do-while. For and while loops check the loop condition at the beginning of each iteration, while do-while checks at the end. Loops are useful for tasks like printing something many times without copying/pasting code. Looping can also be nested, with one loop placed inside another, to create more complex programs.
Final project powerpoint template (fndprg) (1)jewelyngrace
The document discusses various programming topics including looping, switch case statements, and different types of loops in C++ programming such as for, while, and do while loops. Examples of each loop type are provided written in C++ code.
Final requirement in programming niperosmarkings17
Here is an example of a basic for loop in C++:
for (int i = 0; i < 10; i++) {
cout << i << endl;
}
This loop will print the numbers 0 through 9. It initializes the variable i to 0, checks that i is less than 10 for the condition, and increments i by 1 each iteration via i++.
Final requirement in programming vinsonmonstergeorge
Here are the key steps in a for loop:
1. Initialize a counter variable (often i) to track the number of iterations
2. Define a condition to check on each iteration (often i < 10)
3. Increment/decrement the counter variable after each iteration (often i++)
4. The code block inside the for loop will repeat until the condition is no longer true
So in summary, a for loop allows you to repeat a block of code a specific number of times by initializing/updating a counter variable and checking its value on each iteration.
Looping statements in PHP include the while, do-while, for, and foreach loops. The while loop checks the condition first before iterating, while the do-while loop checks after iterating. The for loop is used when the number of iterations is known in advance. It initializes, checks a condition, and increments between iterations. The foreach loop iterates over arrays, allowing access to both values and keys. The break statement exits the current loop, while continue skips to the next iteration.
This document discusses different types of loops in C++ programming including for loops, while loops, do-while loops, and infinite loops. It provides examples of each loop type and explanations of how they work. It also covers switch-case statements, providing an example case statement that prints different outputs depending on the user's input number.
Switch statements and looping statements are key programming concepts. Switch statements allow a program to evaluate an expression and branch to different blocks of code based on the resulting value. Common switch statements include if/else. Looping statements let a program repeat blocks of code a specified number of times or while a condition remains true. Common looping statements include while, do/while, and for loops. Together, switch and looping statements allow programs to selectively execute code and repeat tasks as needed to process inputs and achieve the desired output.
Powerpoint presentation final requirement in fnd prgalyssa-castro2326
The document provides examples of switch case statements in C++ programming. The first example displays different functions based on the number input by the user. The second example displays different messages depending on the number between 1-6 entered by the user. The third example displays messages based on the letter 'a', 'b', or 'c' chosen by the user. All examples use a switch case statement to direct program flow and output based on the user's input variable.
Final project powerpoint template (fndprg) (1)heoff
The switch statement compares the value of an expression to a list of integer or character constants. For each matching case, the statements within that case will be executed until a break statement is reached. If no cases match, the default statements will be executed. The switch statement provides an alternative to multiple if/else if statements for selecting between multiple options.
Iterative structures, also known as loops, repeat sections of code and are used for tasks like calculating multiple values, computing iterative results, printing tables of data, and processing large amounts of input or array data. The three types of loops in C++ are the while loop, do-while loop, and for loop, each with different test conditions to control the loop execution. Loops can also be nested within each other to perform multiple iterations or to loop through multi-dimensional data structures.
The document discusses switch case statements in programming. It provides details on the basic format and usage of switch case statements, including that they allow a variable to be tested for equality against multiple values through different cases. The document also notes some key rules for switch cases, such as requiring a break statement at the end of each case and that case values must be integer or character constants. It provides examples of switch case statements and discusses how they can provide a cleaner alternative to long if-else statements.
VBScript is a lightweight scripting language that can be used for both client-side and server-side programming. It is a light version of Visual Basic. VBScript supports variables, arrays, procedures, functions, conditional statements like If-Else and Select Case, and loops like For Each, Do While, and Do Until loops. Built-in functions provide date, time, and mathematical capabilities.
Loop control statements in C are used to repeatedly execute a block of code while or until a given condition is true. There are three main types of loop control statements in C: for, while, and do-while loops. The for loop allows executing a block of code a specific number of times. The while loop repeatedly executes the block as long as the condition is true. The do-while loop is similar to the while loop, but it will always execute the block at least once even if the condition is false.
C lecture 4 nested loops and jumping statements slideshareGagan Deep
Nested Loops and Jumping Statements(Loop Control Statements), Goto statement in C, Return Statement in C Exit statement in C, For Loops with Nested Loops, While Loop with Nested Loop, Do-While Loop with Nested Loops, Break Statement, Continue Statement : visit us at : www.rozyph.com
The document discusses different types of loops in C++ including while, do-while, for, and switch-case statements. It provides examples of using each loop or statement to repeat operations a certain number of times or while a condition is met. Key examples include a countdown loop using while, calculating factorials with for, and a calculator program using switch-case to perform math operations.
Of complicacy of programming, or won't C# save us?PVS-Studio
Programming is hard. I hope no one would argue that. But the topic of new programming languages, or more exactly, search of a "silver bullet" is always highly popular with software developers. The most "trendy" topic currently is superiority of one programming language over the other. For instance, C# is "cooler" than C++. Although holy wars are not the reason why I'm writing this post, still it is a "sore subject" for me. Oh, come on, C#/lisp/F#/Haskell/... won't let you write a smart application that would interact with the outer world and that's all. All the elegance will disappear as soon as you decide to write some real soft and not a sample "in itself".
This document lists various bridesmaid dress options available for purchase from a UK wedding dress website, including dresses in blue, purple, red, pink, and green colors as well as vintage styles. Specific dresses highlighted include a blue ruched one shoulder dress, blue ruched halter dress, and various purple, vintage, and affordable bridesmaid dress options available through the website.
On this modern entire world where individuals are operating 24 hours a day, people will not have long to wind down. Therefore whatever time one receives a single desires that it is truly unique.
Leave your car at home! maverick my city 2013 projectNuzul Putri
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
Beer and Sewage?! Sewage Powered Robot?!
Join Good Bug on his travels around the world to learn more about the cool things being done with sewage globally!
Celebrating 10 Years of Innovation in EuropeGE_India
Research happens when great minds work together to solve some of the world’s toughest challenges. At our research centers around the world, we have established an incredible pool of world class talent who are making an impact. Our team in Munich, specifically, is collaborating on projects with every GE business and with multiple customers. The work done in Munich has an effect on renewables and energy systems, composites manufacturing technologies for the Oil & Gas industry and aviation, and advanced medical diagnostic equipment.
Learn more about the last decade of technology, and find out what’s next for GE Global Research in Europe.
This document provides an overview of GE's 6F.01 gas turbine technology. It discusses the product's evolution from the 6C gas turbine, its modular design, validation testing, commercial operations including over 110,000 operating hours and 99.2% reliability. The 6F.01 is positioned as offering F-class efficiency at 50MW block sizes for combined cycle and cogeneration applications.
The document discusses key aspects of establishing a solid foundation for a successful magazine publishing business. It emphasizes the importance of understanding the target readership, developing a reliable business model with diversified funding sources, building an effective team, and fostering strong relationships with readers and partners. Additionally, it addresses challenges modern publishers face with information overload and the need to facilitate community discussions rather than just provide content. Overall the document provides strategic advice focused on mission, service orientation, and reader-centered approaches for magazine publishers.
How to "make a face" of your team in media. The modern technologies allow to leverage tremendously the process of personal brand building. See how it happens in today's media
The document provides tips for raising funds for a magazine, including establishing a solid business model, diversifying income sources, and effective fundraising. It discusses sources of funding like foundations, businesses, donors, and investors. Various fundraising methods are outlined, such as mail fundraising letters, grant proposals, newsletters, and meetings with business people to discuss donations. Developing a long-term fundraising plan with a variety of activities is also recommended.
This document provides an overview of research methods and best practices for conducting reader research. It discusses that research involves formal curiosity and asking questions with a purpose. There are two main types of research: primary research involving new data collection, and secondary research using existing data. When writing questions, it is important to have clear goals and ask effective, easy to understand questions. Both quantitative and qualitative methods are covered, noting their different focuses and analysis approaches. The document also offers tips for increasing survey response rates, analyzing results, and conducting a class exercise to design a research plan with questions.
This document discusses how to build and manage an industry-leading brand. It defines a brand as a consumer's gut feeling about a company based on their experiences, not just marketing claims. Strong brands keep customers loyal, attract investors and employees, and separate a business from competitors. Brands are created by appealing to emotions over logic and satisfying deeper needs. Effective brand management ensures all communications consistently convey the intended brand personality. The document provides tips for developing brand strategies that focus on the customer experience rather than just products or services.
The document discusses strategies for diversifying revenue sources away from traditional dominant streams. It suggests that magazines consider revenue from areas like events, innovations, and digital presence in addition to advertising, sales, and subscriptions. While these new sources may help sustain magazines, rising costs may require industry consolidation. The document then provides tools to develop new revenue sources, including using reader data to guide product development, creating plans to manage expectations and scale offerings, and leveraging technology to segment audiences and deliver content efficiently. It offers several potential new revenue ideas and principles for sustainable development, such as starting small with low-risk pilots.
There are 7 phases in the life of a magazine:
1. Concept phase where the idea is developed through research over 6 months to 3 years.
2. Test phase where the concept is tested with the target audience over 6 months to 1 year.
3. Funding phase where money is raised for launch over 1 to 2 years.
4. Launch phase where the magazine is published for the first time over 1 year.
5. Growth phase where circulation gradually increases over 1 to 10 years.
6. Optimum phase where circulation is stable.
7. Decline phase where circulation decreases and the magazine may eventually cease publication.
Programming involves instructing a computer using a programming language. There are different types of loops in programming including for, while, and repeat loops. A for loop repeats a block of code a fixed number of times based on a counting variable. It has three expressions for initialization, condition, and increment. A switch statement provides a clear way to select one of many code blocks to execute based on the value of a variable.
The document discusses switch case statements and looping in programming. It provides examples of switch case statements that check the value of a variable and execute different code blocks depending on the value. It also discusses the different types of loops - for, while, and do-while loops - and provides examples of each. The examples demonstrate how to use switch cases and loops to repeat blocks of code or make decisions based on variable values.
This document contains information about programming languages and examples of programs written in C programming language. It discusses different programming concepts like variables, loops, switch statements, and provides 5 examples of programs using these concepts. The programs demonstrate how to print outputs based on user input or calculations using switch statements, loops, and variables. The document is meant to be submitted to Prof. Erwin M. Globio and provides resources to learn programming at http://eglobiotraining.com.
A computer program is a sequence of instructions that tells a computer to perform tasks. Programs are written by programmers in human-readable source code and then compiled into an executable form for the computer to run directly. Common programming languages include C++, Java, and Python. Switch-case statements allow programmers to write code that performs different actions depending on the value of a variable.
This document provides an overview of programming concepts and Arduino workshop content, including:
- It defines programming as writing specific commands in a programming language to create and run applications.
- Programming languages have their own syntax rules like human languages and are used to translate code into machine-understandable binary.
- An integrated development environment (IDE) provides tools like a text editor, compiler, and debugger to facilitate software development. The document introduces the Code::Blocks IDE.
- Core programming concepts covered include variables, data types, conditional statements, loops, and basic debugging. The goal is to equip participants with foundational programming skills.
The document provides information about different types of loops in programming:
- Loops allow repeating a block of code a specified number of times, which is useful for tasks like displaying lists that require repeating an operation.
- A for loop repeats until a specific number of iterations is reached, as defined by its initialization, condition, and increment/decrement components.
- A while loop continuously repeats a block of code as long as a given condition remains true.
- Examples are given demonstrating the use of while and for loops to repeatedly output the values of a variable in C++.
OpenGurukul : Language : C++ ProgrammingOpen Gurukul
This document provides information about C++ classes and objects. It defines what a class is, noting that classes are like structures but with additional features such as data hiding and default private access. An object is defined as an instance of a class. The document discusses access specifiers like public, private, and protected. It also covers static variables and functions, constant functions, and friend functions/classes.
The document outlines a course on problem solving with computers that covers topics like control structures, functions, pointers, object-oriented programming, inheritance, and managing console I/O operations across 5 modules taught over a period of 30 contact hours from April 13th to May 1st, with tests, assignments, and a final exam comprising the total course assessment of 60 marks plus a final exam worth 40 additional marks.
The document outlines a course on problem solving with computers that covers topics like control structures, functions, pointers, object-oriented programming, inheritance, and managing console I/O operations across 5 modules taught over a period of 30 contact hours from April 13th to May 1st, with tests, assignments, and a final exam comprising the assessment. It discusses different programming constructs like sequences, selections, loops, and decisions that form the basis of writing computer programs to solve problems. The document also provides examples of code snippets to demonstrate printing output, taking user input, and performing basic arithmetic operations like addition in C++.
This document provides an overview of C++ programming concepts including control statements, decision making constructs, loops, arrays, functions, user-defined data types like structures and unions, and enumerations. It discusses various control structures like if/else, for/while loops, and break/continue statements. It also covers functions, including inline functions and function overloading. Finally, it summarizes structures, unions, and enumerations - specifically how structures group related variables, unions share memory, and enumerations assign limited values to variables.
C is a programming language developed in the 1970s that is commonly used to write system software and applications. It is efficient, flexible, and requires less memory than other languages. C++ builds on C by adding object-oriented features. Programming languages use looping and conditional statements like for, while, do-while, and switch-case to control program flow and repetition. These statements allow code to be executed repeatedly or conditionally based on expressions.
The document discusses different types of looping statements in programming languages. It describes while, do-while, for, and foreach loops. It explains that while and do-while loops check a condition each iteration, for loops allow initializing and changing a counter, and foreach loops iterate over array elements. It also mentions break and continue statements that alter loop execution flow. Examples of each looping statement are provided with links to online code samples.
The document discusses different types of looping and conditional statements in programming languages.
1) A switch statement allows program execution to branch to different code blocks based on the value of a variable. It can improve clarity over repetitive if/else statements and may execute faster through compiler optimizations.
2) A for loop repeats a block of code a specified number of times. It is commonly used when the number of iterations is known beforehand.
3) If/else statements allow executing one block of code if a condition is true, and optionally executing another block if the condition is false. Else if blocks can test multiple conditions.
The document discusses different types of looping statements in programming languages including while, do-while, for, and foreach loops. It provides examples of the syntax for each loop and explains their usage - while and do-while loops check a condition each iteration, for loops initialize and increment a counter, and foreach loops iterate over array elements. Break and continue statements are also covered which can exit or skip iterations in loops respectively.
Programming involves instructing a computer using a programming language. It allows organizing ideas about processes and things. Programming languages let programmers develop applications and scripts for computers to execute. Programming involves understanding codes, program development, and applications like web browsers. Switch cases and looping systems are important programming concepts. Switch cases allow selecting different code blocks based on a variable. Common looping structures include for, while, do-while, and foreach loops, which repeat a block of code a specified number of times. Programming requires attention to syntax and careful coding to avoid errors.
Fundamentals of programming final santosAbie Santos
This document discusses programming concepts like switch case statements, looping statements, and if-else statements. It provides examples of code and explanations of how to write and run different statements in C++. It also includes links to external websites that contain additional examples of programming concepts and how they appear when compiled and executed.
The document discusses different loop structures in C++ including the for loop, do-while loop, and while loop. It provides examples of how to write each type of loop and explains the differences between them. The for loop has initialization, test, and update expressions that control the loop iterations. The do-while loop first executes the body and then evaluates the test expression, so it always runs at least once. Both for and while loops check the test expression before executing the body.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...alexjohnson7307
Predictive maintenance is a proactive approach that anticipates equipment failures before they happen. At the forefront of this innovative strategy is Artificial Intelligence (AI), which brings unprecedented precision and efficiency. AI in predictive maintenance is transforming industries by reducing downtime, minimizing costs, and enhancing productivity.
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on automated letter generation for Bonterra Impact Management using Google Workspace or Microsoft 365.
Interested in deploying letter generation automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
This presentation provides valuable insights into effective cost-saving techniques on AWS. Learn how to optimize your AWS resources by rightsizing, increasing elasticity, picking the right storage class, and choosing the best pricing model. Additionally, discover essential governance mechanisms to ensure continuous cost efficiency. Whether you are new to AWS or an experienced user, this presentation provides clear and practical tips to help you reduce your cloud costs and get the most out of your budget.
2. Programming
We first define the word “programming”, it is a
computer language programmers use to develop
applications, scripts, or other set of instructions for a
computer to execute.
programming is instructing a computer to do something
for you with the help of a programming language. The role
of a programming language can be described in two ways:
Technical: It is a means for instructing a Computer to
perform Tasks
Conceptual: It is a framework within which we organize
our ideas about things and processes.
http://eglobiotraining.com
3. As an individual, I have learned that programming is a
very broad because it composes many scripts, applications
and can be used to run a program that has been part of the
programming language.
A programming language should both provide means to
describe primitive data and procedures and means to
combine and abstract those into more complex ones.
http://eglobiotraining.com
4. The distinction between data and procedures is not that
clear cut. In many programming languages, procedures can
be passed as data (to be applied to ``real'' data) and
sometimes processed like ``ordinary'' data. Conversely
``ordinary'' data can be turned into procedures by an
evaluation mechanism.
http://eglobiotraining.com
5. At first, programming is confusing because you have so
much to understand about codes that will enable to run a
program. Programming has applications and program
development, the best example for this is the Internet
bowser…
Programming is a creative process done by
programmers to instruct a computer on how to do a task.
Programming languages let you use them in different ways,
e.g adding numbers, etc… or storing data on disk for later
retrieval.
http://eglobiotraining.com
6. You have to consider languages to run or write your
own program, most demanded language in programming is
the DEV C++ (a full-featured Integrated Development
Environment (IDE)).
C++ is one of the most used programming languages
in the world. Also known as "C with Classes".
New to programming or thinking about it? It might surprise
you to know that there are many programmers who
program just for fun and it can lead to a job.
http://eglobiotraining.com
7. Switch Case
Switch case statements are a substitute for long if
statements that compare a variable to several
"integral" values ("integral" values are simply values
that can be expressed as an integer, such as the value of
a char).
http://eglobiotraining.com
8. basic format for using switch case:
switch ( <variable> ) {
case this-value:
Code to execute if <variable> == this-value
break;
case that-value:
Code to execute if <variable> == that-value
break;
...
default:
Code to execute if <variable> does not equal the value
following any of the cases
break;
}
The value of the variable given into switch is compared to the
value following each of the cases, and when one value matches
the value of the variable, the computer continues executing the
program from that point.
http://eglobiotraining.com
9. The condition of a switch
statement is a value. The case says
that if it has the value of whatever
is after that case then do whatever
follows the colon.
http://eglobiotraining.com
10. The break is used to break out of
the case statements. An important
thing to note about the switch
statement is that the case values may
only be constant integral expressions.
http://eglobiotraining.com
11. Break is a keyword that breaks
out of the code block, usually
surrounded by braces, which it is in.
In this case, break prevents the
program from falling through and
executing the code in all the other
case statements.
http://eglobiotraining.com
12. The default case is optional, but it is
wise to include it as it handles any
unexpected cases. Switch statements
serves as a simple way to write long if
statements when the requirements are
met. Often it can be used to process
input from a user.
http://eglobiotraining.com
13. This shows how would you use a Switch in a Program
#include <iostream>
using namespace std;
void playgame()
{
cout << "Play game called";
}
void loadgame()
}
cout << "Load game called";
void playmultiplayer()
{
cout << "Play multiplayer game called";
}
int main()
{
int input;
cout<<"1. Play gamen";
cout<<"2. Load gamen";
cout<<"3. Play multiplayern";
cout<<"4. Exitn";
cout<<"Selection: "; cin>> input;
switch ( input ) {
case 1: // Note the colon, not a semicolon
playgame();
break;
case 2: // Note the colon, not a semicolon
loadgame();
break;
case 3: // Note the colon, not a semicolon
playmultiplayer();
break;
case 4: // Note the colon, not a semicolon
cout<<"Thank you for playing!n";
break;
default: // Note the colon, not a semicolon
cout<<"Error, bad input, quittingn";
break;
http://eglobiotraining.com
}
cin.get();
}
14. That program will compile, but cannot be run
until the undefined functions are given
bodies, but it serves as a model (albeit
simple) for processing input. If you do not
understand this then try mentally putting in if
statements for the case statements. Default
simply skips out of the switch case
construction and allows the program to
terminate naturally. If you do not like that,
then you can make a loop around the whole
thing to have it wait for valid input. You could
easily make a few small functions if you wish
to test the code.
http://eglobiotraining.com
15. Looping
Loops are used to repeat a block of
code. Being able to have your program
repeatedly execute a block of code is
one of the most basic but useful tasks
in programming -- many programs or
websites that produce extremely
complex output (such as a message
board) are really only executing a
single task many times.
http://eglobiotraining.com
16. (They may be executing a small
number of tasks, but in principle, to
produce a list of messages only
requires repeating the operation of
reading in some data and displaying
it.) Now, think about what this
means: a loop lets you write a very
simple statement to produce a
significantly greater result simply by
repetition.
http://eglobiotraining.com
17. One Caveat: before going further, you
should understand the concept of C++'s
true and false, because it will be
necessary when working with loops (the
conditions are the same as with if
statements).
Three types of Loops:
for, while, and do..
http://eglobiotraining.com
18. FOR
For ( variable initialization; condition; variable update ) {
Code to execute while the condition is true
}
http://eglobiotraining.com
19. The variable initialization allows you to either declare a variable
and give it a value or give a value to an already existing variable.
Second, the condition tells the program that while the conditional
expression is true the loop should continue to repeat itself. The
variable update section is the easiest way for a for loop to handle
changing of the variable. It is possible to do things like x++, x =
x + 10, or even x = random ( 5 ), and if you really wanted to, you
could call other functions that do nothing to the variable but still
have a useful effect on the code.
Notice that a semicolon separates each of these sections, that is
important. Also note that every single one of the sections may be
empty, though the semicolons still have to be there. If the
condition is empty, it is evaluated as true and the loop will
repeat until something else stops it.
http://eglobiotraining.com
20. Example:
#include <iostream>
using namespace std; // So the program can see cout and endl
int main()
{
// The loop goes while x < 10, and x increases by one every loop
for ( int x = 0; x < 10; x++ ) {
// Keep in mind that the loop condition checks
// the conditional statement before it loops again.
// consequently, when x equals 10 the loop breaks.
// x is updated before the condition is checked.
cout<< x <<endl;
}
cin.get();
}
This program is a very simple example of a for loop. x is
set to zero, while x is less than 10 it calls cout<< x
<<endl; and it adds 1 to x until the condition is met.
Keep in mind also that the variable is incremented after
the code in the loop is run for the first time.
http://eglobiotraining.com
21. WHILE
The basic structure:
While ( condition ) { Code to execute while the
condition is true } The true represents a boolean
expression which could be x == 1 or while ( x != 7
) (x does not equal 7). It can be any combination of
boolean statements that are legal. Even, (while x
==5 || v == 7) which says execute the code while
x equals five or while v equals 7. Notice that a while
loop is the same as a for loop without the
initialization and update sections. However, an
empty condition is not legal for a while loop as
it is with a for loop.
http://eglobiotraining.com
22. Example:
#include <iostream>
using namespace std; // So we can see cout and endl
int main()
{
int x = 0; // Don't forget to declare variables
while ( x < 10 ) { // While x is less than 10
cout<< x <<endl;
x++; // Update x so the condition can be met eventually
}
cin.get();
}
The easiest way to think of the loop is that when it reaches the
brace at the end it jumps back up to the beginning of the
loop, which checks the condition again and decides whether to
repeat the block another time, or stop and move to the next
statement after the block.
http://eglobiotraining.com
24. The condition is tested at the end of
the block instead of the beginning, so the
block will be executed at least once. If the
condition is true, we jump back to the
beginning of the block and execute it
again.
http://eglobiotraining.com
25. A do.. while loop is basically a reversed while
loop. A while loop says "Loop while the condition is
true, and execute this block of code", a do.. while
loop says "Execute this block of code, and loop while
the condition is true".
http://eglobiotraining.com
26. Example:
#include <iostream>
using namespace std;
int main()
{
int x;
x = 0;
do {
// "Hello, world!" is printed at least one time
// even though the condition is false
cout<<"Hello, world!n";
} while ( x != 0 );
cin.get();
}
Keep in mind that you must include a trailing semi-colon after
the while in the above example. A common error is to forget
that a do..while loop must be terminated with a semicolon (the
other loops should not be terminated with a semicolon, adding
to the confusion). Notice that this loop will execute once,
because it automatically executes before checking the
condition.
http://eglobiotraining.com
28. LOOPING STATEMENT 1
#include <iostream>
int main()
{
using namespace std;
// nSelection must be declared outside do/while loop
int nSelection;
do
{
cout << "Please make a selection: " << endl;
cout << "1) Addition" << endl;
cout << "2) Subtraction" << endl;
cout << "3) Multiplication" << endl;
cout << "4) Division" << endl;
cin >> nSelection;
} while (nSelection != 1 && nSelection != 2 &&
nSelection != 3 && nSelection != 4);
// do something with nSelection here
// such as a switch statement
return 0;
}
http://eglobiotraining.com
29. LOOPING STAEMENT 2
#include <iostream>
using namespace std;
int main()
{
int nSelection;
double var1, var2;
do
{
cout << "Please make a selection: " << endl;
cout << "1) Addition" << endl;
cout << "2) Subtraction" << endl;
cout << "3) Multiplication" << endl;
cout << "4) Division" << endl;
cin >> nSelection;
}
while (nSelection != 1 && nSelection != 2 &&
nSelection != 3 && nSelection != 4);
if (nSelection == 1)
{
cout << "Please enter the first whole number ";
cin >> var1;
cout << "Please enter the second whole number ";
cin >> var2;
cout << "The result is " << (var1+var2) << endl;
}
http://eglobiotraining.com
30. LOOPING STATEMENT 3
if (nSelection == 2)
{
cout << "Please enter the first whole number ";
cin >> var1;
cout << "Please enter the second whole number ";
cin >> var2;
cout << "The result is " << (var1-var2) << endl;
}
if (nSelection == 3)
{
cout << "Please enter the first whole number ";
cin >> var1;
cout << "Please enter the second whole number ";
cin >> var2;
cout << "The result is " << (var1*var2) << endl;
}
if (nSelection == 4)
{
cout << "Please enter the first whole number ";
cin >> var1;
cout << "Please enter the second whole number ";
cin >> var2;
cout << "The result is " << (var1/var2) << endl;
}
return 0;
}
http://eglobiotraining.com
31. LOOPING STATEMENT 3
#include <iostream>
using namespace std;
int main()
{
int nSelection;
double var1, var2;
while (1)
{
do
{
cout << "Please make a selection: " << endl;
cout << "1) Addition" << endl;
cout << "2) Subtraction" << endl;
cout << "3) Multiplication" << endl;
cout << "4) Division" << endl;
cout << "5) Exit" << endl;
cin >> nSelection;
} while (nSelection != 1 && nSelection != 2 &&
nSelection != 3 && nSelection != 4 &&
nSelection != 5);
if (nSelection == 1)
{
cout << "Please enter the first whole number ";
cin >> var1;
cout << "Please enter the second whole number ";
cin >> var2;
cout << "The result is " << (var1+var2) << endl;
}
http://eglobiotraining.com
32. LOOPING STATEMENT 4
else if (nSelection == 2)
{
cout << "Please enter the first whole number ";
cin >> var1;
cout << "Please enter the second whole number ";
cin >> var2;
cout << "The result is " << (var1-var2) << endl;
}
else if (nSelection == 3)
{
cout << "Please enter the first whole number ";
cin >> var1;
cout << "Please enter the second whole number ";
cin >> var2;
cout << "The result is " << (var1*var2) << endl;
}
else if (nSelection == 4)
{
cout << "Please enter the first whole number ";
cin >> var1;
cout << "Please enter the second whole number ";
cin >> var2;
cout << "The result is " << (var1/var2) << endl;
}
else
{
return 0;
}
}
}
http://eglobiotraining.com
33. LOOPING STATEMENT 5
#include <iostream>
using namespace std; // So the program can see cout and endl
int main()
{
// The loop goes while x < 10, and x increases by one every loop
for ( int x = 0; x < 10; x++ ) {
// Keep in mind that the loop condition checks
// the conditional statement before it loops again.
// consequently, when x equals 10 the loop breaks.
// x is updated before the condition is checked.
cout<< x <<endl;
}
cin.get();
}
http://eglobiotraining.com
34. LOOPING STATEMENT 6
#include <iostream>
using namespace std;
int main()
{
int x;
x = 0;
do {
// "Hello, world!" is printed at least one time
// even though the condition is false
cout<<"Hello, world!n";
} while ( x != 0 );
cin.get();
}
http://eglobiotraining.com
35. LOOPING STATEMENT 7
#include <iostream>
using namespace std;
int main ()
{
int n;
cout << "Enter the starting number > ";
cin >> n;
while (n>0) {
cout << n << ", ";
--n;
}
cout << "FIRE!n";
return 0;
}
http://eglobiotraining.com
36. SWITCH CASE 1
SWITCH CASE
#include <iostream>
using namespace std;
int main ()
{
int score;
cout << "What was your score?";
cin >> score;
if (score <= 25)
{
cout << "nOuch, less than 25...!";
}
http://eglobiotraining.com
37. SWITCH CASE 2
else if (score <= 50)
{
cout << "nYou score aint great mate..";
}
else if (score <= 75)
{
cout << "nYour pretty good, wel done man!";
}
else if (score <= 100)
{
cout << "nYou got to the top!!!";
}
http://eglobiotraining.com
39. SWITCH CASE 4
#include <iostream>
using namespace std;
int main(){
cout << "Enter a number between 1 and 5!" << endl;
int number;
cin >> number;
if(number == 1){
cout << "one";
}
else if(number == 2){
cout << "two";
}
else if(number == 3){
cout << "three";
}
else if(number == 4){
cout << "four";
}
else if(number == 5){
cout << "five";
}
else{
cout << number << " is not between 1 and 5!";
}
cout << endl;
system("pause");
}
http://eglobiotraining.com
40. SWITCH CASE 5
#include <iostream>
using namespace std;
int main()
{
int price_before_discount, RM, dozen, total_price;
cout<< "How much is the price before discount for 1 dozen boxes of tissue?n";
cout<<"RM ";
cin>>price_before_discount;
cout<<"nn";
cout<< "How many dozen boxes of tissue you buy?n";
cin>>dozen;
cout<<"nn";
switch (dozen)
{
total_price = ((price_before_discount*dozen) * (95/100));
case '1': cout<< "Total price is RM ";
cout<<RM;
cout<<"nn";
break;
total_price = ((price_before_discount*dozen) * (88/100));
case '2': cout<< "Total price is RM ";
cout<<RM;
cout<<"nn";
break;
total_price = ((price_before_discount*dozen) * (75/100));
case '3': cout<< "Total price is RM ";
cout<<RM;
cout<<"nn";
break;
total_price = ((price_before_discount*dozen) * (60/100));
case '4' : cout<< "Total price is RM ";
cout<<RM;
cout<<"nn";
break;
total_price = ((price_before_discount*dozen) * (40/100));
default : cout<< "Total price is RM ";
cout<<RM;
cout<<"nn";
}
return 0;
}
http://eglobiotraining.com
41. SWITCH CASE 6
#include <stdlib.h>
#include <stdio.h>
int main(void) {
int n;
printf("Please enter a number: ");
scanf("%d", &n);
switch (n) {
case 1: {
printf("n is equal to 1!n");
break;
}
case 2: {
printf("n is equal to 2!n");
break;
}
case 3: {
printf("n is equal to 3!n");
break;
}
default: {
printf("n isn't equal to 1, 2, or 3.n");
break;
}
}
system("PAUSE");
return 0;
}
http://eglobiotraining.com
42. SWITCH CASE 7
#include <iostream>
using namespace std;
int main(void)
{
char grade;
cout << "Enter your grade: ";
cin >> grade;
switch (grade)
{
case 'A':
cout << "Your average must be between 90 - 100"
<< endl;
break;
case 'B':
cout << "Your average must be between 80 - 89"
<< endl;
break;
case 'C':
cout << "Your average must be between 70 - 79"
<< endl;
break;
case 'D':
cout << "Your average must be between 60 - 69"
<< endl;
break;
default:
cout << "Your average must be below 60" << endl;
}
return 0;
}
http://eglobiotraining.com
43. An output
program using Dev C++
http://eglobiotraining.com
44. In this looping statement, I used “while” looping, and I choose
to show MDAS just as an example for the program to
run. If logical Expression evaluates to true, the
statement executes. The logical Expression is
reevaluated. The body of the loop continues to execute until
thehttp://eglobiotraining.com
logicalExpression is false
45. I have came up with this by just starting to write this
code: #include <iostream> and then enter the
succeeding codes, compiled and run.
http://eglobiotraining.com
46. I noticed that sometimes if the program does not run, it is
because some braces are not included and I accidentally
put braces on the same line and it causes the program
not to read its contents. Programming is sensitive, when
there is missing variable or braces or some words it does
not run.
http://eglobiotraining.com
47. When I learned that programming is very sensitive
and at the same time very detailed when it comes to
entering codes, I make sure that it is clear means that
I put everything important codes in it so that the
program would run.
http://eglobiotraining.com
48. So much codes that should be entered that even the
spaces are needed programming is very specific that
whatever you have entered in to it you should specify
because when the statement is false it wouldn’t let you run
the program, I have experienced it before I arrived at this
result.
http://eglobiotraining.com
49. Because of so many experiences I had before this
program run, I found programming is also interesting
for the more you are practicing to make a program run,
the more questions that came up in my mind and try
something that will fit to this or entering new codes to
http://eglobiotraining.com etc… that I know is possible.
make matrix
50. In this switch case missing out a break statement causes
control to fall through to the next case label. Switches can
always be replaced by nested if-else statements, but in
some cases this may be more clumsy.
Each break statement terminates the
enclosing switch statement. Control flow continues with the
http://eglobiotraining.com
first statement
51. Unlike if-then and if-then-else statements,
the switch statement can have a number of possible execution
paths, A switch works with the byte, short, char,
and int primitive data types.
http://eglobiotraining.com
52. The switch statement evaluates its expression, then
executes all statements that follow the matching case label.
http://eglobiotraining.com
53. The switch statement can include any number
of case instances, but no two case constants within the
same switch statement can have the same value. Execution
of the statement body begins at the selected statement and
proceeds until the jump-statement transfers control out of
the case body.
http://eglobiotraining.com
54. Submitted to:
Prof. Erwin Globio
Submitted by:
Francisco, Kimberly
BM10203
http://eglobiotraining.com