Microsoft Excel 2016 Basics Course contentsAnil Kumar
Microsoft Excel 2016 Basics course for Beginners
Objective: This is free Microsoft Excel 2016 Basics course. In this course, you will learn about working with Microsoft Excel 2016.
After completion of this course, you will be familiar to work with Microsoft Excel 2016.
Microsoft Excel 2016 Basics Course Contents
1. Introduction to Microsoft Excel 2016
2. Microsoft Excel 2016 New Features
3. Microsoft Excel 2016 Application Interface
4. Data Entry in Excel, Cells and Ranges
5. Formatting Data and Conditional Formatting
6. Introduction to Tables
7. Saving Workbooks in Multiple Formats
8. Basic Functions in Excel
9. Creating Charts
10. Printing Options in Excel 2016
check out more details about this course from http://msofficeguru.in (Anil Kumar Devarasetti)
This document provides a lesson on formatting text in Microsoft Word 2010. It discusses formatting text using bold, italics, underline, font type and size, character spacing, and font color. The document demonstrates how to apply these formatting options using tools on the ribbon, the mini toolbar, and keyboard shortcuts. It includes examples of formatting characters, changing font size and color, applying styles like bold and italics, and using shortcut keys.
This document discusses different techniques for software testing, including static and dynamic techniques. It covers specification-based or black-box techniques like equivalence partitioning, boundary value analysis, decision tables, and state transition testing. Equivalence partitioning involves dividing inputs into equivalent partitions, while boundary value analysis focuses on testing values at the boundaries of partitions. Decision tables systematically test combinations of inputs. State transition testing models the different states a system can be in and the transitions between states.
risk based testing and regression testingToshi Patel
Risk-based testing prioritizes and focuses testing efforts based on identified risks. It aims to uncover defects in critical areas through early risk identification and guiding subsequent testing activities. Regression testing ensures that changes to a system do not introduce new defects by re-executing test cases. It helps reduce quality risks and improves customer confidence through systematic analysis of software changes and their impacts.
This document provides instructions for using basic Microsoft Excel functions including opening Excel, navigating the worksheet, entering and formatting data, using autofill, and basic formatting options. It demonstrates how to add and delete worksheets, enter and format text and numbers, select cells, cut/copy/paste data, adjust row and column sizes, and more. The document is a tutorial for getting started with the basic Excel interface and functions.
FYBSC IT Digital Electronics Unit IV Chapter II Sequential Circuits- Flip-FlopsArti Parab Academics
Sequential Circuits: Flip-Flop:
Introduction, Terminologies used, S-R flip-flop, D flip-fop, JK flipflop, Race-around condition, Master – slave JK flip-flop, T flip-flop, conversion from one type of flip-flop to another, Application of flipflops.
The document discusses different levels of software testing:
- Unit testing checks individual code units and is done by developers.
- Integration testing checks interactions between code units.
- System testing evaluates the entire integrated system.
- User acceptance testing involves end users validating that the system meets requirements.
This document provides an introduction to software design principles and methods. It discusses the overall goal of teaching a systematic and repeatable approach to software architecture design. Key topics covered include software products and design, abstraction and modeling, different types of design, the role of design in the software lifecycle, and an introduction to the Agile software engineering design method. The document provides definitions and explanations of important software design concepts.
This document discusses DML and DDL in SQL. DML is used to manipulate data in databases through statements like SELECT, UPDATE, DELETE, and INSERT. It allows users to specify and modify data. DDL is used to define and modify database structures through statements like CREATE, ALTER, DROP, TRUNCATE, and RENAME. DDL manages database schemas and DML manages the data. Both have advantages like shared data, integrity, security and efficiency.
This document discusses formal methods in software engineering. It defines formal methods as mathematically-based techniques for specifying, developing, and verifying computer systems in a systematic way. Formal methods use formal logic to model systems and prove that models satisfy requirements. The document provides an example of applying formal methods to specify a water tank system that refills when low. Key steps include: 1) defining types and functions, 2) stating properties as logical statements, and 3) constructing proofs to show properties hold for all cases.
System testing involves testing a fully integrated software application to verify it meets requirements. It is done after unit and integration testing. System testing checks interactions between components, verifies functional and non-functional requirements, and validates the architecture. Test cases cover use cases and validate all types of requirements. The system is tested as a whole in a controlled environment to check for defects before delivery.
This document provides an overview of software testing, including definitions, types of testing, and the software testing lifecycle. It defines software testing as a method to assess software functionality. The key points covered are:
- Software testing ensures software does what it's intended to do and remains functional after changes.
- Types of testing include unit, integration, system, and regression testing.
- The software testing lifecycle includes planning, developing test cases, executing tests, and closing test cycles.
- Cloud testing can reduce regression testing time by using virtualized hardware and software services.
The document discusses software quality and testing. It defines software reliability as the probability of failure-free operation of a computer program in a given environment and time. Testing aims to find errors in programs to improve reliability, rather than show a program works correctly. The document outlines ISO quality standards for software development including ISO 9001, which provides a framework for quality processes and procedures. Organizations must comply with ISO 9001 requirements to achieve quality certification.
I. The 8 main parts of a typical computer keyboard are:
1. Main Keypad
2. Function Keys
3. Modifier Keys
4. Legacy Keys
5. Navigation Keys
6. Numeric Keypad
7. Indicator Lights
8. Windows and Menu Key
II. The groups for the given keys are:
1. Main Keypad
2. Legacy Keys
3. Modifier Keys
4. Function Keys
5. Main Keypad
6. Main Keypad
7. Navigation Keys
8. Numeric Keypad
9. Main Keypad
10. Navigation Keys
This document provides an introduction to programming with Scratch. It discusses what programming is, why people learn to program, and how Scratch allows anyone to program without complicated syntax. It then previews the topics that will be covered in subsequent Scratch lessons, including statements, boolean expressions, conditions, loops, variables, threads, and events. It encourages completing the homework assignments of various Scratch projects.
This Document about is C Programming language. You will learn Operators in C.
Types of operators-
Arithmetic Operators
Relational Operators
Increment Operator
Decrement Operator
Logical Operators
Conditional Operator
This document summarizes different types of loops in C programming: for loops, while loops, and do-while loops. It explains the basic structure of each loop type, including where the initialization, test condition, and updating of the loop variable occurs. It also distinguishes between entry controlled loops (for and while) and exit controlled loops (do-while). Additional loop concepts covered include break and continue statements, and sentinel controlled loops. Examples are provided to illustrate usage of each loop type.
Looping statements in Java include the while, do-while, and for loops. The while loop executes a statement repeatedly as long as a condition is true. The do-while loop executes a statement once before checking the condition, and continues executing as long as the condition remains true. The for loop allows initialization of a counter variable, a condition to test on each iteration, and an increment statement to execute after each iteration. Loops can become infinite if the condition is never made false, and loops can be nested by placing one loop inside the body of another.
In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number.
This document provides an overview of program control structures in C++ including conditional statements like if/else and switch statements as well as loops like for, while, and do-while. It explains the syntax and usage of each structure with examples. Key points covered include conditional branching, nested control structures, the break and continue keywords, whitespace and comments. The document emphasizes best practices for indentation and formatting source code for readability. It concludes with notes on maintaining a log book of programming work for grading purposes.
Iterative control structures, looping, types of loops, loop workingNeeru Mittal
Introduction to looping, for loop. while loop, do loop jump statements, entry controlled vs exit controlled loop, algorithm and flowchart of loops, factorial of a number
This is a lecture from Introduction to Java Programming on Repetition Statements (Loops). It covers both theoretical and practical aspects of the use of Repetition Statements (Loops). It covers also a wide variety of examples covering different points pertaining to this topic.
The document discusses looping statements in Java, including while, do-while, and for loops. It provides the syntax for each loop and explains their logic and flow. While and for loops check a condition before each iteration of the loop body. Do-while loops check the condition after executing the body at least once. Nested loops run the inner loop fully for each iteration of the outer loop. Infinite loops occur if the condition is never made false, causing the program to run indefinitely.
System Verilog introduces several new control flow constructs compared to Verilog, including unique if, priority if, foreach loops, and enhanced for loops. It also adds tasks and functions with arguments that can be passed by value, reference, or name. System Verilog defines two types of blocks - sequential blocks that execute statements sequentially and parallel blocks like fork-join that execute statements concurrently. It introduces various timing controls like delays, events, and wait statements.
The document discusses various loop constructs in C language including while loops, do-while loops, and for loops. It explains the syntax and usage of each loop type and compares while and do-while loops. The document also covers logical operators, formatted input/output functions, controlling loop execution, and one-dimensional arrays in C.
This document discusses DML and DDL in SQL. DML is used to manipulate data in databases through statements like SELECT, UPDATE, DELETE, and INSERT. It allows users to specify and modify data. DDL is used to define and modify database structures through statements like CREATE, ALTER, DROP, TRUNCATE, and RENAME. DDL manages database schemas and DML manages the data. Both have advantages like shared data, integrity, security and efficiency.
This document discusses formal methods in software engineering. It defines formal methods as mathematically-based techniques for specifying, developing, and verifying computer systems in a systematic way. Formal methods use formal logic to model systems and prove that models satisfy requirements. The document provides an example of applying formal methods to specify a water tank system that refills when low. Key steps include: 1) defining types and functions, 2) stating properties as logical statements, and 3) constructing proofs to show properties hold for all cases.
System testing involves testing a fully integrated software application to verify it meets requirements. It is done after unit and integration testing. System testing checks interactions between components, verifies functional and non-functional requirements, and validates the architecture. Test cases cover use cases and validate all types of requirements. The system is tested as a whole in a controlled environment to check for defects before delivery.
This document provides an overview of software testing, including definitions, types of testing, and the software testing lifecycle. It defines software testing as a method to assess software functionality. The key points covered are:
- Software testing ensures software does what it's intended to do and remains functional after changes.
- Types of testing include unit, integration, system, and regression testing.
- The software testing lifecycle includes planning, developing test cases, executing tests, and closing test cycles.
- Cloud testing can reduce regression testing time by using virtualized hardware and software services.
The document discusses software quality and testing. It defines software reliability as the probability of failure-free operation of a computer program in a given environment and time. Testing aims to find errors in programs to improve reliability, rather than show a program works correctly. The document outlines ISO quality standards for software development including ISO 9001, which provides a framework for quality processes and procedures. Organizations must comply with ISO 9001 requirements to achieve quality certification.
I. The 8 main parts of a typical computer keyboard are:
1. Main Keypad
2. Function Keys
3. Modifier Keys
4. Legacy Keys
5. Navigation Keys
6. Numeric Keypad
7. Indicator Lights
8. Windows and Menu Key
II. The groups for the given keys are:
1. Main Keypad
2. Legacy Keys
3. Modifier Keys
4. Function Keys
5. Main Keypad
6. Main Keypad
7. Navigation Keys
8. Numeric Keypad
9. Main Keypad
10. Navigation Keys
This document provides an introduction to programming with Scratch. It discusses what programming is, why people learn to program, and how Scratch allows anyone to program without complicated syntax. It then previews the topics that will be covered in subsequent Scratch lessons, including statements, boolean expressions, conditions, loops, variables, threads, and events. It encourages completing the homework assignments of various Scratch projects.
This Document about is C Programming language. You will learn Operators in C.
Types of operators-
Arithmetic Operators
Relational Operators
Increment Operator
Decrement Operator
Logical Operators
Conditional Operator
This document summarizes different types of loops in C programming: for loops, while loops, and do-while loops. It explains the basic structure of each loop type, including where the initialization, test condition, and updating of the loop variable occurs. It also distinguishes between entry controlled loops (for and while) and exit controlled loops (do-while). Additional loop concepts covered include break and continue statements, and sentinel controlled loops. Examples are provided to illustrate usage of each loop type.
Looping statements in Java include the while, do-while, and for loops. The while loop executes a statement repeatedly as long as a condition is true. The do-while loop executes a statement once before checking the condition, and continues executing as long as the condition remains true. The for loop allows initialization of a counter variable, a condition to test on each iteration, and an increment statement to execute after each iteration. Loops can become infinite if the condition is never made false, and loops can be nested by placing one loop inside the body of another.
In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it, and then some condition is checked such as whether a counter has reached a prescribed number.
This document provides an overview of program control structures in C++ including conditional statements like if/else and switch statements as well as loops like for, while, and do-while. It explains the syntax and usage of each structure with examples. Key points covered include conditional branching, nested control structures, the break and continue keywords, whitespace and comments. The document emphasizes best practices for indentation and formatting source code for readability. It concludes with notes on maintaining a log book of programming work for grading purposes.
Iterative control structures, looping, types of loops, loop workingNeeru Mittal
Introduction to looping, for loop. while loop, do loop jump statements, entry controlled vs exit controlled loop, algorithm and flowchart of loops, factorial of a number
This is a lecture from Introduction to Java Programming on Repetition Statements (Loops). It covers both theoretical and practical aspects of the use of Repetition Statements (Loops). It covers also a wide variety of examples covering different points pertaining to this topic.
The document discusses looping statements in Java, including while, do-while, and for loops. It provides the syntax for each loop and explains their logic and flow. While and for loops check a condition before each iteration of the loop body. Do-while loops check the condition after executing the body at least once. Nested loops run the inner loop fully for each iteration of the outer loop. Infinite loops occur if the condition is never made false, causing the program to run indefinitely.
System Verilog introduces several new control flow constructs compared to Verilog, including unique if, priority if, foreach loops, and enhanced for loops. It also adds tasks and functions with arguments that can be passed by value, reference, or name. System Verilog defines two types of blocks - sequential blocks that execute statements sequentially and parallel blocks like fork-join that execute statements concurrently. It introduces various timing controls like delays, events, and wait statements.
The document discusses various loop constructs in C language including while loops, do-while loops, and for loops. It explains the syntax and usage of each loop type and compares while and do-while loops. The document also covers logical operators, formatted input/output functions, controlling loop execution, and one-dimensional arrays in C.
The document discusses operators, loops, and conditional statements in C#. It covers various arithmetic, logical, binary, and comparison operators as well as operator precedence. It also covers the if, if-else, switch, break, continue, for, while, do-while, and foreach conditional statements and loops. Examples are provided for arithmetic operators, if/else statements, switch statements, and while loops. The document concludes with exercises involving reading input, ordering numbers, printing patterns, and calculating factorials and powers using loops and conditional statements.
Looping statements allow code to be repeatedly executed. The while loop executes a block of code as long as a condition is true. The for loop initializes a counter variable, tests a condition, and increments the counter each iteration to repeat a block of code a specified number of times. Loops can be nested, with an inner loop executing completely within each iteration of the outer loop. Infinite loops occur when the condition controlling the loop is never made false, causing the loop to repeat indefinitely until interrupted.
Control structures in C++ include loops like while, do/while and for to repeat actions. Switch, break and continue statements are also covered. The document discusses counter-controlled and sentinel-controlled repetition, and provides examples of calculating a class average using different loop structures. Nested control structures are demonstrated with an example analyzing exam results from 10 students.
This document provides an overview of programming loops and different types of loops. It discusses while loops and for loops. While loops repeat code until a condition is met, and for loops iterate over a sequence a set number of times. It provides examples of infinite loops and how to end loops using break or changing conditions. Different types of loops are demonstrated including condition-controlled and count-controlled loops. Activities are included to practice different loop structures.
This document discusses different types of control structures in programming languages that control program flow, including selection statements and iterative statements. Selection statements like if/else statements and switch statements allow a program to select between alternative paths of execution. Iterative statements like for loops and while loops allow repeated execution of statements. Loop control structures like break and continue allow skipping parts of loops. Unconditional branching with goto is also discussed but is discouraged due to readability concerns.
The document discusses different types of loops in programming languages. It defines looping as repetitively executing a sequence of statements, which is an important concept that allows programs to repeat tasks. There are two main types of loops - entry controlled loops where the test condition is checked before the loop body executes, and exit controlled loops where the test is checked after execution. Common loops in C include the for, while, and do-while loops. The for loop is entry controlled and uses a counter variable, while the while and do-while can use counters or sentinel values and are entry and exit controlled respectively. Selecting the right loop depends on pre-test or post-test needs as well as whether the number of repetitions is known.
This document discusses flow control in Python, including selection (branching) and repetition (looping). It covers basic concepts of loops like initialization, testing, the loop body, and updating. It explains counter-controlled and sentinel-controlled loops. It provides examples of using while and for loops in Python, including using range() to generate sequences. It also discusses nested loops, and control statements like break, continue, and pass.
The document discusses control structures in C programming, including conditional statements and loops.
It describes the if statement and if-else statement, which allow conditional execution of code based on boolean expressions. It also covers the switch statement for selecting between multiple code blocks based on an integral expression.
The document also discusses three loop structures in C - while, for, and do-while loops. The while and for loops repeat code while/for a given condition is true. The do-while loop executes code once before checking the condition. Increment/decrement operators are commonly used to update loop counters in for loops.
This chapter discusses repetition control structures in C++ like while, for, and do-while loops. It explains how to construct count-controlled, sentinel-controlled, and flag-controlled loops. It also covers break and continue statements, and how to create nested loops to produce patterns like a triangle of increasing asterisks.
Clock Definitions Static Timing Analysis for VLSI EngineersJason J Pulikkottil
Rising and falling edge of the clock
For a +ve edge triggered design +ve (or rising) edge is called ‘leading edge’ whereas –ve (or falling) edge is called ‘trailing edge’.
For a -ve edge triggered design –ve (or falling) edge is called ‘leading edge’ whereas +ve (or rising) edge is called ‘trailing edge’.
basic clock
Minimum pulse width of the clock can be checked in PrimeTime by using commands given below:
set_min_pulse_width -high 2.5 [all_clocks]
set_min_pulse_width -low 2.0 [all_clocks]
These checks are generally carried out for post layout timing analysis. Once these commands are set, PrimeTime checks for high and low pulse widths and reports any violations.
Capture Clock Edge
The edge of the clock for which data is detected is known as capture edge.
Launch Clock Edge
This is the edge of the clock.
•Find approximate locations of a set of modules that need to be placed on a layout surface.
•Floorplan is one the critical & important steps in Physical design.
•Quality of the Chip / Design implementation depends on how good is the Floorplan.
•A good floorplan can make implementation process (place, cts, route) easy.
•On the other side a bad floorplan can create all kind of issues in the design (congestion, timing, noise, routing issues).
• Standard cells are designed based on power, area and performance.
• First step is cell architecture. Cell architecture is all about deciding cell height based on pitch &
library requirements. We have to first decide the track, pitch, β ratio, possible PMOS width and
NMOS width.
• Track : Track is generally used as a unit to define the height of the std cell.Track can be related
to lanes e.g. like we say 4 lane road, implies 4 vehicles can run in parallel. Similarly, 9 track
library implies 9 routing tracks are available for routing 9 wires in parallel with minimum pitch.
• Pitch : The distance between two tracks is called as pitch.
• Via : Vias are used to connect two different metal layers as shown in Fig. 1(a). In Fig.1(b), we
are connecting M1 and M2 using a Via. We don’t make tracks with minimum spacing as we will
get DRC error if there is any via overhang.
Physical design is process of transforming netlist into layout
which is manufacture-able [GDS]. Physical design process is
often referred as PnR (Place and Route) / APR (Automatic Place
& Route). Main steps in physical design are placement of all
logical cells, clock tree synthesis & routing. During this process
of physical design timing, power, design & technology
constraints have to be met. Further design might require being
optimized w.r.t area, power and performance.
Goals of Floor Plan:
1. Partition the design into functional blocks
2. Arrange the blocks on a chip
3. Place the Macros
4. Decide the location of the I/O pads
5. Decide the location and number of the power
pads
6. Decide the type of power distribution
This document provides information about the Fifth edition of the magazine "Sthapatya" published by the Association of Civil Engineers (Practicing) Aurangabad. It includes messages from current and past presidents of ACEP, memories and photos from past ACEP events, information on life time achievement awards given by ACEP, and a technical article on concrete maintenance, repairs and strengthening. The document highlights activities of ACEP and provides a technical educational article for members.
OCS Group SG - HPHT Well Design and Operation - SN.pdfMuanisa Waras
This course is delivered as a scenario-based course to
provide knowledge of High Pressure and High-Temperature (HPHT) well design, drilling and completion operations. The course is specifically designed to provide an
understanding of the challenges associated with the design
and construction of HPHT wells. The course guides the
participants to work through the various well design
aspects starting from a geological well proposal with an
estimated formation pressure and temperature profile.
Working with real well data allows the participants to learn
not only theory, technicalities and practicalities of drilling
and completing HPHT wells but it also ensures that participants gain real experience in understanding the HPHT issues.
Rigor, ethics, wellbeing and resilience in the ICT doctoral journeyYannis
The doctoral thesis trajectory has been often characterized as a “long and windy road” or a journey to “Ithaka”, suggesting the promises and challenges of this journey of initiation to research. The doctoral candidates need to complete such journey (i) preserving and even enhancing their wellbeing, (ii) overcoming the many challenges through resilience, while keeping (iii) high standards of ethics and (iv) scientific rigor. This talk will provide a personal account of lessons learnt and recommendations from a senior researcher over his 30+ years of doctoral supervision and care for doctoral students. Specific attention will be paid on the special features of the (i) interdisciplinary doctoral research that involves Information and Communications Technologies (ICT) and other scientific traditions, and (ii) the challenges faced in the complex technological and research landscape dominated by Artificial Intelligence.
Blood bank management system project report.pdfKamal Acharya
The main objective of the “Blood Bank management System” all the details in the Blood
Bank’sprocess. This project has some tasks to maintain the Blood Bank through computerization.
Using this blood bank system people can search blood group available which they are needed.
They check it on using our blood bank management website. If in case blood group is not available
in blood bank they can also contact numbers of the persons who has the same blood group he is
need. And he can request the person to done the blood for saving someone life.
The Project describes the smart Blood Bank management system. This report will help you
to know in deep the actual work that has been done as a team work. The main objective of this
application is to automate the complete operations of the blood bank. They need to maintain
hundreds of thousands of records. Also searching should be very faster, so they can find required
details instantly. Main objective is to create a system which helps them to complete their work
faster in simple way by using computer not the oldest way which is used paper. Also our project
contains updated information and many things else.
The project consists of a central repository containing various blood deposits available
along with associated details. These details include blood type, storage area and date of storage.
These details help in maintaining and monitoring the blood deposits. The project is an online
system that allows checking weather required blood deposits of a particular group are available in
the blood bank. Moreover the system also has added features such as patient name and contacts,
blood booking and even need for certain blood group is posted on the website to find available
donors for a blood emergency. This online system is developed on PHP platform and supported
by an MYSQL database to store blood and user specific details.
4th International Conference on Computer Science and Information Technology (...ijait
4th International Conference on Computer Science and Information Technology
(COMSCI 2025) will act as a major forum for the presentation of innovative ideas,
approaches, developments, and research projects in the area computer Science and
Information Technology. It will also serve to facilitate the exchange of information
between researchers and industry professionals to discuss the latest issues and
advancement in the research area.
Decoding Kotlin - Your Guide to Solving the Mysterious in Kotlin - Devoxx PL ...João Esperancinha
Kotlin can be very handy and easy to use. Kotlin offers the possibility to develop code that is easy to understand, safe, immutable, and thus predictable and follows standards that avoid side effects. I realized that very quickly after I started my Kotlin journey that already amounts to more than 5 years.
This is the third version of this presentation focused on more detail explaining inline, crossinline, tailrec and as a bonus a quick run through unnamed classes.
A SEW-EURODRIVE brake repair kit is needed for maintenance and repair of specific SEW-EURODRIVE brake models, like the BE series. It includes all necessary parts for preventative maintenance and repairs. This ensures proper brake functionality and extends the lifespan of the brake system
1. Introduction to Computer Programming
Control Structures – Repetition
C++ Programming: From Problem Analysis to Program Design
1
2. • Basic loop structures
• while loops
• Interactive while loops
• for loops
• Loop programming techniques
• Nested loops
• do whileloops
• Common programming errors
Chapter Topics
2
3. • Suppose you want to add five numbers to find their
average. From what you have learned so far, you
could proceed as follows:
• Assume that all variables are properly declared
Why Is Repetition Needed?
3
4. Why Is Repetition Needed?
• Suppose you want to add and average 100, 1000, or
more numbers
– You would have to declare that many variables
– List them again in cin statements
• This takes an exorbitant amount of space and time
• Also, if you want to run this program again with
different values or with a different number of
values, you have to rewrite the program
4
5. • Suppose you want to add the following numbers:
5 3 7 9 4
• Consider the following statements, in which sum
and num are variables of type int:
1. sum = 0;
2. cin >> num;
3. sum = sum + num;
• Each time you need to add a new number, you
repeat statements 2 and 3
Why Is Repetition Needed?
5
6. • Repetition structure has four required elements:
– Repetition statement
– Condition to be evaluated
– Initial value for the condition
– Loop termination
• Repetition statements include:
– while
– for
– do while
Basic Loop Structures
6
f o r ( i = 0 ; i < 1 0 ; i + + )
c o u t < < i ;
7. • The condition can be tested
– At the beginning: Pretest or entrance‐controlled loop
(while, for)
– At the end: Posttest or exit‐controlled loop (do‐while)
• Something in the loop body must cause the
condition to change, to avoid an infinite loop, which
never terminates
Basic Loop Structures (continued)
7
8. • Pretest loop: Condition
is tested first; if false,
statements in the loop
body are never
executed
• while and for loops
are pretest loops
Pretest and Posttest Loops
A pretest loop
8
9. Pretest and Posttest Loops (continued)
• Posttest loop: Condition is
tested after the loop body
statements are executed;
loop body always executes
at least once
• do while is a posttest
loop
A posttest loop
9
10. • Fixed‐count loop: Loop is processed for a fixed
number of repetitions
• Variable‐condition loop: Number of repetitions
depends on the value of a variable
Fixed‐Count Versus Variable‐Condition
Loops
10
f o r ( i = 0 ; i < 1 0 ; i + + )
c o u t < < i ;
f o r ( i = 0 ; i < a ; i + + )
c o u t < < i ;
11. while Loops
• while statement is used to create a while loop
– Syntax:
while (expression)
statement;
• Statements following the expressions are executed
as long as the expression condition remains true
(evaluates to a non‐zero value)
11
15. Counter‐Controlled while Loops
• Suppose that a set of statements needs to be executed N
times
• You can set up a counter (initialized to 0 before the while
statement) to track how many items have passed
15
19. while Loops with Sentinels
• Sentinel: A data value used to signal either the start
or end of a data series
• Use a sentinel when you don’t know how many values
need to be entered (looping is controlled by the user)
19
23. Flag‐Controlled while Loops
• A flag‐controlled while loop uses a bool variable to control
the loop.
• Suppose found is a bool variable. The flag‐controlled while
loop takes the following form:
23
24. • break statement
– Forces an immediate break, or exit, from
switch, while, for, and do-while
statements
– Violates pure structured programming, but is
useful for breaking out of loops when an unusual
condition is detected
break and continue Statements
24
25. • Example of a break statement:
break and continue Statements
(cont’d)
25
26. • continue statement
– Applies to while, do-while, and for statements;
causes the next iteration of the loop to begin
immediately
– Useful for skipping over data that should not be
processed in this iteration, while staying within the
loop
break and continue Statements
(cont’d)
26
27. • A continue statement where invalid grades are
ignored, and only valid grades are added to the total:
break and continue Statements
(cont’d)
27
28. • Null statement
– Semicolon with nothing preceding it
• ;
– Do‐nothing statement required for syntax purposes only
The Null Statement
28
29. for Loops
• for statement: A loop with a fixed count condition
that handles alteration of the condition
– Syntax:
for(initializing list; expression; altering list)
statement;
• Initializing list: Sets the starting value of a counter
• Expression: Contains the maximum or minimum value
the counter can have; determines when the loop is
finished
29
30. for Loops
30
Loop repeated 10 times
Start value 0
End value 9
Increment 1
Last value of i is 10
Note: Only this statement is executed with
the loop since there is no curled brackets.
31. • Altering list: Provides the increment value that is
added or subtracted from the counter in each
iteration of the loop
• If initializing list is missing, the counter initial value
must be provided prior to entering the for loop
• If altering list is missing, the counter must be altered
in the loop body
• Omitting the expression will result in an infinite loop
for Loops (continued)
31
37. • These techniques are suitable for pretest loops ( for
and while):
– Interactive input within a loop
• Includes a cin statement within a while or for loop
– Selection within a loop
• Using a for or while loop to cycle through a set of
values to select those values that meet some criteria
A Closer Look: Loop Programming
Techniques
37
38. A Closer Look: Loop Programming
Techniques (continued)
38
39. A Closer Look: Loop Programming
Techniques (continued)
39
40. A Closer Look: Loop Programming
Techniques (continued)
40
41. • Nested loop: A loop contained within another loop
– All statements of the inner loop must be completely
contained within the outer loop; no overlap allowed
– Different variables must be used to control each loop
– For each single iteration of the outer loop, the inner loop
runs through all of its iterations
Nested Loops
41
44. • do while loop is a posttest loop
– Loop continues while the condition is true
– Condition is tested at the end of the loop
– Syntax:
do
statement;
while (expression);
• All statements are executed at least once in a
posttest loop
do while Loops
44
47. do while Loops (Examples)
47
Loop repeated 5 times
Start value 0
End value 25
Increment 5
Last value of counter is 25
48. • Useful in filtering user‐entered input and providing
data validation checks
• Can enhance with if-else statement
Validity Checks
48
49. • Using the assignment operator (=) instead of the equality
comparison operator (==) in the condition expression
• Placing a semicolon at the end of the for clause, which
produces a null loop body
• Using commas instead of semicolons to separate items in
the for statement
• Changing the value of the control variable
• Omitting the final semicolon in a do statement
Common Programming Errors
49
50. Summary
• Loop: A section of repeating code, whose
repetitions are controlled by testing a condition
• Three types of loops:
– while
– for
– do while
• Pretest loop: Condition is tested at beginning of
loop; loop body may not ever execute; ex., while,
for loops
50
51. Summary (continued)
• Posttest loop: Condition is tested at end of loop;
loop body executes at least once; ex., do while
• Fixed‐count loop: Number of repetitions is set in
the loop condition
• Variable‐condition loop: Number of repetitions is
controlled by the value of a variable
51