While vs do while and input validation loops in Java; Intro Java course Lesson 4 Video 3

Опубликовано: 04 Октябрь 2024
на канале: DesignCodeDebugRepeat
48
3

This series of videos is suitable for programmers with minimal (or no) programming experience who want to learn Java. This is the twentieth video in the Introductory Java series, and the third video in lesson 4 (looping). In this video we're going to look at do while loops, which are post-test loops (as opposed to while loops, which are pre-test loops) and compare the two. We'll look at input validation loops, and how to write them both as pre-test and post-test loops.

There is a suggested (free) book below that you could read along with the videos lessons. However, the video is very straightforward and can also stand alone or accompany any other introductory Java textbook. Let's have some fun learning to program in Java!

PLAYLIST

   • Introduction to Programming in Java, ...  

BOOK AND WEBSITE RESOURCES

Here's the video on complementing Boolean expressions:
   • Complementing Boolean expressions & w...  

This video is suitable to watch after reading Chapters 2 and 3 of Introduction to Programming Using Java, by David J. Eck:
https://math.hws.edu/eck/cs124/downlo...

The Elements of Java Style text is available here*:
https://amzn.to/4c2gn8H
*As an Amazon Associate I earn from qualifying purchases. Your purchases help me continue to bring you content!

The Open JDK page is here:
https://jdk.java.net/

The Eclipse IDE page is here:
https://eclipseide.org/

PRACTICE
You can practice writing the simple quiz as a post-test loop here*:
https://codecheck.io/files/2408081333...

You can practice writing the age validation posttest loop here*:
https://codecheck.io/files/2408081330...

You can practice writing the age validation pretest loop here*:
https://codecheck.io/files/2408081327...

*The CodeCheck system courtesy of Cay Horstmann, https://horstmann.com/codecheck/

If you want to earn credit for learning to code, take an online course at CCRI! These videos are part of the Java Programming course:
https://ccri.edu/comp/

GET THE CODE

The github repository with all of the code examples for Lesson 4 is here:
https://github.com/ProfessorBurke/Jav...

RESOURCE ATTRIBUTIONS

MIT News page about Margaret Hamilton:
https://news.mit.edu/2016/scene-at-mi...

The Basic Latin unicode table can be found here:
https://www.unicode.org/charts/PDF/U0...

Java JDK image from Oracle:
https://www.oracle.com/java/technolog...

Java coffee cup image:
By Mark Anderson (work for hire for Sun Microsystems) - http://www.logoeps.com/java-eps-vecto..., Fair use, https://en.wikipedia.org/w/index.php?...


00:00 Welcome, what you need to know to get the most from this video
00:40 do while
03:53 Input validation loops
08:06 Comparing pretest and posttest loops