ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

how to use do while loop | repetition control structure | #4

Автор: FirstClick

Загружено: 2020-06-21

Просмотров: 87

Описание: How to use do while loop in programming? You use do while loop in programming for repetition of code execution in a block of code.
In today’s class, I will show how to use do while loop and for loop construct for repetition.
The do while loop is written does in pseudocode:
DOWHILE condition p is true
Statement(s) to be repeated here
ENDDO
Explanation:
1. The logical condition p is tested on every pass
2. If condition p is found to be true, then control goes into the loop and execute statement(s) once.
3. Control then returns to test condition p
4. If condition p is found to be false, control passes to the next statement after ENDDO; otherwise control goes into the loop again to execute statement(s) written there. This continues until condition p is false.
A statement written inside the do while loop must alter the condition p to become false, otherwise the loop becomes an endless loop.
Three things are necessary to the setting up of a do while loop
1. The initialization of the condition to be tested to an initial value. The condition is initialize just before the condition testing.
2. The testing of the condition is at the beginning of the loop
3. The only way to terminate the loop is to render the do while loop condition to false
You must write a statement within the statement do while loop block which will eventually change the condition so that the condition becomes false. Failure to do so will definitely result in an endless loop.
In our example for today, we consider the problem statement:
Every day a weather station receives 15 temperatures expressed in degrees Fahrenheit. A program is required to accept each Fahrenheit temperature, convert it to Celsius and display the converted temperature to the screen.
In this example as show in the video, you need to know how to use do while loop in programming or for loop to be able to solve the problem.
This is the solution algorithm in pseudocode as shown in the video also:
INITIALIZE temperature_count to zero
DOWHILE temperature_count less than 15
GET Temp_Fahrenheit
COMPUTE Temp_Centigrade
DISPLAY Temp_C
ADD 1 to temperature_count
ENDDO
The above pseudocode is coded into PHP and the application is test ran to see how to use do while loop in programming. The program is thereafter implemented using a for loop.
Head to the video to see in detail how to use do while loop in programming.
Enjoy the video.

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
how to use do while loop | repetition control structure | #4

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

desk checking example for algorithm in a table format | #5

desk checking example for algorithm in a table format | #5

C_40 Difference between for, while and do while loop in C | C Programming Tutorials

C_40 Difference between for, while and do while loop in C | C Programming Tutorials

Основы ПЛК: структурированный текст

Основы ПЛК: структурированный текст

Linux Command Line for Beginners

Linux Command Line for Beginners

Алгоритмы и структуры данных за 15 минут! Вместо 4 лет универа

Алгоритмы и структуры данных за 15 минут! Вместо 4 лет универа

how to learn programming online| learn to  code for beginners 2020| how to learn programming at home

how to learn programming online| learn to code for beginners 2020| how to learn programming at home

Филипп Робертс: Что за чертовщина такая event loop? | JSConf EU 2014

Филипп Робертс: Что за чертовщина такая event loop? | JSConf EU 2014

Алгоритмы на Python 3. Лекция №1

Алгоритмы на Python 3. Лекция №1

Где начало СХЕМЫ? Понимаем, читаем, изучаем схемы. Понятное объяснение!

Где начало СХЕМЫ? Понимаем, читаем, изучаем схемы. Понятное объяснение!

Программирование с использованием математики | Лямбда-исчисление

Программирование с использованием математики | Лямбда-исчисление

Изучите Java за 14 минут (серьезно)

Изучите Java за 14 минут (серьезно)

Понимание Active Directory и групповой политики

Понимание Active Directory и групповой политики

Выучите R за 39 минут

Выучите R за 39 минут

BODYBUILDERS VS CLEANER  | Anatoly GYM PRANK #56

BODYBUILDERS VS CLEANER | Anatoly GYM PRANK #56

LaTeX for Students – A Simple Quickstart Guide

LaTeX for Students – A Simple Quickstart Guide

Как взломать любое программное обеспечение

Как взломать любое программное обеспечение

Python Tutorial for Absolute Beginners #1 - What Are Variables?

Python Tutorial for Absolute Beginners #1 - What Are Variables?

Основы ПЛК: релейная логика

Основы ПЛК: релейная логика

Loops in flowchart | ThinkComputer

Loops in flowchart | ThinkComputer

Но что такое нейронная сеть? | Глава 1. Глубокое обучение

Но что такое нейронная сеть? | Глава 1. Глубокое обучение

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]