<< Chapter < Page Chapter >> Page >

When the user clicks the button, three separate event handlers on the button test the sum of the left operand and the offset against the right operand for less than , equal to , and greater than and display the results in the three variables having the corresponding names as either true or false.

Make sure that your output matches the output shown in Image 9 for the slider values shown in Image 9 .

A copy of this program has been posted online for your review (see Resources for the URL) . If you don't find the program using that URL, search the Scratch site for the usernamed dbal.

Summary

I began by providing a brief review of material from previous modules.

Then I presented and explained the detailed steps required to write a Scratch program that uses the following relational operators:

<(less than) = (equal to)>(greater than)

Finally, I provided the specifications for a student-programming project for you to demonstrate your understanding of what you learned from the first programand from earlier modules.

Copies of both programs have been posted online for your review (see Resources for the URL) . If you don't find the program using that URL, search the Scratch site for the usernamed dbal.

What's next?

The previous module concentrated on arithmetic operators. This module explained the use of relational operators. The next module will explain the use of logical operators. Future modules using the Scratch programming language will continue to deal with selection and will also deal with loops .

Resources

General resources

Programs used in this collection

Miscellaneous

This section contains a variety of miscellaneous information.

Housekeeping material
  • Module name: Scr0350: Relational Operators in Scratch 2.0
  • File: Scr0350.htm
  • Published:05/16/13
Disclaimers:

Financial : Although the Connexions site makes it possible for you to download a PDF file for thismodule at no charge, and also makes it possible for you to purchase a pre-printed version of the PDF file, you should beaware that some of the HTML elements in this module may not translate well into PDF.

I also want you to know that, I receive no financial compensation from the Connexions website even if you purchase the PDF version of the module.

In the past, unknown individuals have copied my modules from cnx.org, converted them to Kindle books, and placed them for sale on Amazon.com showing me as the author. Ineither receive compensation for those sales nor do I know who does receive compensation. If you purchase such a book, please beaware that it is a copy of a module that is freely available on cnx.org and that it was made and published withoutmy prior knowledge.

Affiliation : I am a professor of Computer Information Technology at Austin Community College in Austin, TX.

-end-

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Teaching beginners to code. OpenStax CNX. May 27, 2013 Download for free at http://cnx.org/content/col11498/1.20
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Teaching beginners to code' conversation and receive update notifications?

Ask