<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ideawaza.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=220.233.0.0%2F16</id>
	<title>IdeaWazaWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://ideawaza.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=220.233.0.0%2F16"/>
	<link rel="alternate" type="text/html" href="https://ideawaza.com/wiki/Special:Contributions/220.233.0.0/16"/>
	<updated>2026-09-29T15:54:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Foresight_Linux&amp;diff=73638</id>
		<title>Archive:Foresight Linux</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Foresight_Linux&amp;diff=73638"/>
		<updated>2015-05-25T02:27:33Z</updated>

		<summary type="html">&lt;p&gt;220.233.104.253: Added info on site shutdown under External Links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox OS&lt;br /&gt;
| name = Foresight&lt;br /&gt;
| logo = [[Image:Foresight Linux Logo 2.png|200px]]&lt;br /&gt;
| screenshot = [[File:Foresightlinux lxde 2.5.2.png|300px]]&lt;br /&gt;
| caption = The Foresight Linux 2.5.2 desktop with [[LXDE]]&lt;br /&gt;
| website = [https://www.foresightlinux.se/ https://www.foresightlinux.se]&lt;br /&gt;
| developer = Foresight Community&lt;br /&gt;
| family = [[Unix-like]]&lt;br /&gt;
| source_model = Mixed source&lt;br /&gt;
| latest_release_version = ([[Rolling release]]) 2.5.3&lt;br /&gt;
| latest_release_date = {{release date and age|2013|04|12}}&lt;br /&gt;
| latest_test_version =&lt;br /&gt;
| latest_test_date =&lt;br /&gt;
| marketing_target =&lt;br /&gt;
| language =&lt;br /&gt;
| kernel_type = [[Monolithic kernel|Monolithic]] ([[Linux kernel|Linux]])&lt;br /&gt;
| ui = [[GNOME]], [[KDE]], [[LXDE]], [[Xfce]]&lt;br /&gt;
| license =&lt;br /&gt;
| working_state = Discontinuated&lt;br /&gt;
| supported_platforms = [[IA-32]], [[x86-64]]&lt;br /&gt;
| updatemodel = [[PackageKit]] (gnome-packagekit)&lt;br /&gt;
| package_manager = [[Conary (package manager)|Conary]]&lt;br /&gt;
}}&lt;br /&gt;
&#039;&#039;&#039;Foresight Linux&#039;&#039;&#039; was a [[Linux distribution]] comprising [[free software|free]] and [[proprietary software]] with the goal of showcasing the latest in Linux desktop technologies. Foresight is developed by the Foresight community and follows a [[rolling release]] cycle, instead of a time-based release schedule.&lt;br /&gt;
&lt;br /&gt;
The [http://article.gmane.org/gmane.linux.foresight.devel/2857 project announced it will be shutting down] per the end of May 2015.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
Foresight was created by Ken VanDine as a [[Linux distribution]] to showcase the most current releases of [[GNOME]] while working on the GNOME Marketing team.&amp;lt;ref name=&amp;quot;Creating the GNOME 2.18 Live Media: An interview with Ken VanDine&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since then it has undergone change through generally minor revisions (via rolling release). This is in contrast to the system of major changes with each version number employed by many other distributions. However, there have been occasional major changes, most notably the transition from Foresight 1.x to Foresight 2. Along the way several original deficiencies have been cured as well, among them the lack of 64 bit support, which was introduced in Foresight 2, and the lack of a graphical package manager, which was filled by [[PackageKit]].&lt;br /&gt;
&lt;br /&gt;
After the release of Foresight 2, the developers held a packaging contest within the community in order to boost the number of applications available for the new release, either by porting them from Foresight 1, or packaging them afresh. The contest was sponsored by [[Shuttle Inc.]], Foresight&#039;s OEM partner, in the form of computers (Shuttle&#039;s KPC) and peripherals for the winners.&amp;lt;ref name=&amp;quot;Foresight Contest Announcement&amp;quot;/&amp;gt; Though originally planned to last one month, the contest was extended to two near the end of the first so that a greater number of packages could be completed. The process of testing all of the completed packages {{as of  | 2009&lt;br /&gt;
| alt=is currently underway}}, and no official announcements have been made as to the winner.&lt;br /&gt;
&lt;br /&gt;
While originally a GNOME-based distribution, from version 2.5.0 [[Xfce]] and [[KDE]] desktops have been introduced.&lt;br /&gt;
&lt;br /&gt;
Foresight was the recipient of the Ovatio Award for 2008 &#039;&#039;Distro of the Year&#039;&#039; by Ars Technica.&amp;lt;ref name=&amp;quot;The 2008 Ovatio Awards, by Ars Technica&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
Foresight focuses on delivering the latest in desktop technologies. It usually has current packages for the GNOME desktop environment, sometimes even within a day of their release. Projects such as [[GNOME Do]], [[Banshee (media player)|Banshee]] and [[PackageKit]] are delivered in the default Foresight installation. Beyond the existing GNOME Edition, Xfce and KDE Edition are available. These two editions have the same focus of delivering the latest desktop technologies for the respective desktop environments.&lt;br /&gt;
&lt;br /&gt;
Foresight uses the [[Conary (package manager)|Conary]] package management system. This system only updates those specific files in packages which need to be updated, in contrast to other package managers such as [[RPM Package Manager|RPM]] and [[dpkg]] which install whole packages. Conary also has the advantage of very granular dependency resolution, and a relatively easy packaging process, with [[Software repository|repositories]] provided to the community, free of charge, by [[RPath|rPath, Inc.]]&lt;br /&gt;
&lt;br /&gt;
All packages are updated in a rolling release style, i.e. as updates are released upstream, or packagers get to them. Packages move between three branches of the foresight repositories, originating usually at the development branch or in the personal repositories of packagers, after which they are promoted to the Quality Assurance branch, and finally to the Stable branch, intended for users. [[Snapshot (computer storage)|Snapshots]] are taken every few months, and new [[ISO image]]s are produced.&lt;br /&gt;
&lt;br /&gt;
== Vendor support ==&lt;br /&gt;
Foresight is available pre-installed on the [[Shuttle Inc.|Shuttle]]&#039;s light-weight KPC system.&amp;lt;ref name=&amp;quot;KPC Specifications&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist|refs=&lt;br /&gt;
&amp;lt;ref name=&amp;quot;Creating the GNOME 2.18 Live Media: An interview with Ken VanDine&amp;quot;&amp;gt;{{ cite web |title = Creating the GNOME 2.18 Live Media: An interview with Ken VanDine |url = http://www.gnomejournal.org/article/57/creating-the-gnome-218-live-media-an-interview-with-ken-vandine }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;Foresight Contest Announcement&amp;quot;&amp;gt;{{ cite web |title = Foresight Contest Announcement |url = http://www.foresightlinux.org/contest.html }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;The 2008 Ovatio Awards, by Ars Technica&amp;quot;&amp;gt;{{ cite web |title = The 2008 Ovatio Awards, by Ars Technica |url = http://arstechnica.com/articles/culture/ars-awards-2008.ars/7 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ref name=&amp;quot;KPC Specifications&amp;quot;&amp;gt;{{cite web |url=http://us.shuttle.com/KPC/techspecs.html |title=KPC Specifications |accessdate=2008-05-26 |publisher=[[Shuttle Inc.]] |archiveurl = http://web.archive.org/web/20080518034750/http://us.shuttle.com/KPC/techspecs.html &amp;lt;!-- Bot retrieved archive --&amp;gt; |archivedate = 2008-05-18}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://www.foresightlinux.org/ Project home page] (Site shutdown - checked on May 25, 2015)&lt;br /&gt;
* [http://us.shuttle.com/kpc/index.htm Shuttle KPC home page]&lt;br /&gt;
&lt;br /&gt;
{{Linux-distro}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Conary-based Linux distributions]]&lt;br /&gt;
[[Category:X86-64 Linux distributions]]&lt;/div&gt;</summary>
		<author><name>220.233.104.253</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Micah_Moore&amp;diff=62774</id>
		<title>Archive:Micah Moore</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Micah_Moore&amp;diff=62774"/>
		<updated>2008-08-21T06:12:04Z</updated>

		<summary type="html">&lt;p&gt;220.233.119.93: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Female adult bio|&lt;br /&gt;
name=      Micah Moore|&lt;br /&gt;
photo= [[Image:MicahMooreHeadShot.jpg|200px]] |&lt;br /&gt;
birth=     {{birth date and age|1987|10|05}}|&lt;br /&gt;
death=     |&lt;br /&gt;
location=    [[Oregon]], [[United States|U.S.]]|&lt;br /&gt;
measurements=  34a-24-34|&lt;br /&gt;
height=     {{height|ft=5|in=8}}|&lt;br /&gt;
weight=     {{convert|110|lb|kg|abbr=on|lk=on}}|&lt;br /&gt;
eye color=   Brown|&lt;br /&gt;
hair color=   Brown|&lt;br /&gt;
natural bust=  yes|&lt;br /&gt;
ethnicity=   [[German American]], [[Native Americans in the United States|Native American]] |&lt;br /&gt;
alias=     Mika, Micha, Mica Moore| &lt;br /&gt;
homepage=  http://www.ClubMicah.com/  |&lt;br /&gt;
iafd=      MicahMoore|&lt;br /&gt;
imdb=      2398911|&lt;br /&gt;
afdb=      43304|&lt;br /&gt;
afdb name=   Micah Moore|&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Micah Moore&#039;&#039;&#039; (born on [[October 5]] [[1987]] in [[Oregon]]) is a [[United States|American]] [[pornographic actor|pornographic actress]].&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Moore has been in the adult film industry since 2006 when she was 18. Her first movie was Teen Dreams #13. Her name is spelled Micah Moore, but she has been credited on websites as Mika, Micha, and Micha More.&lt;br /&gt;
&lt;br /&gt;
== Porn and acting career ==&lt;br /&gt;
&lt;br /&gt;
During her senior year in high school Micah began working in a popular coffee shop where she met future porn star [[Mckenzee Miles]], who was another hopeful adult actress. The two girls moved in together and began stripping at a local strip club in [[Beaverton, Oregon]]. &amp;quot;...we started stripping at a club. We didn&#039;t take it very seriously. We were doing the robot on stage and shit like that. It didn&#039;t go over very well.&amp;quot;&amp;lt;ref name=PVN&amp;gt;{{cite web|url=http://www.pornvalleynews.com/home/archives/2006/12/micah_moore_int.html|title= Micah Moore Interview|month=December|year=2006|publisher=PornValleyNews|accessdate=2007-09-20}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the spring of 2006, Micah and Mckenzee shot their first porn videos in [[Ft. Lauderdale, Florida]]. After filming finished, Micah flew home to finish high school.&lt;br /&gt;
&lt;br /&gt;
In summer 2006, Moore and Miles left Portland and moved to the [[San Fernando Valley]] in southern [[California]]. Once there, Micah successfully began working with a number of legitimate movie companies and starred in over 39 adult DVDs and videos, quickly making a name for herself in the porn industry with titles such as Wasted Youth 2, Muff Bumpers, Fresh Newcummers, and Ass Fixation 2.&amp;lt;ref&amp;gt;{{cite web|url=http://www.imdb.com/name/nm2398911/|title= Micah Moore IMDB Page|accessdate=2007-09-20}}&amp;lt;/ref&amp;gt; She worked solidly for over a year.&lt;br /&gt;
&lt;br /&gt;
Micah has done solo, girl/girl, and boy/girl, but never gave into the pleading demand for more. She attended the [[AVN Adult Entertainment Expo]] in 2007 and was met by many adoring fans.&amp;lt;ref&amp;gt;{{cite web|url=http://youtube.com/watch?v=dxGVBCGhrxE|title= Micah Moore attends AEE 2007|accessdate=2007-09-20}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
In July 2007, Micah announced that she would no longer shoot boy/girl scenes and would only engage in girl/girl or solo work.&amp;lt;ref name=AINews2007&amp;gt;[http://ainews.com/Archives/Story12184.phtml &amp;quot;Micah Moore Goes Like Totally Vegan&amp;quot;],  [[July 31]], [[2007]], Bad Ass Models Company Press Release, Adult Industry News. Retrieved [[2007-12-13]].&amp;lt;/ref&amp;gt; She left the porn industry in shortly after the [[AVN Awards]] in [[Las Vegas, Nevada]], and moved back to [[Oregon]] to start her undergraduate work.&amp;lt;ref name=PVN2007&amp;gt;[http://www.pornvalleynews.com/home/archives/2007/07/micah_moore_say_1.html &amp;quot;Micah Moore Says Goodbye to Porn&amp;quot;], Porn Valley News, [[July 16]], [[2007]]. Retrieved [[2007-12-13]].&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In her life she has fucked 22 people, ranging from black to whites and girls with dildos, but she has fucked one person 13 times and that is your mother.&lt;br /&gt;
&lt;br /&gt;
She has fucked me millions of time and right now is giving me a hadn job, a blow job and we are now moving on to anal.&lt;br /&gt;
&lt;br /&gt;
Anyone wanting to fuck me really hard(my dick is 21cm)call me on 0423347169.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
{{Commonscat|Micah_Moore}}&lt;br /&gt;
*[http://www.ClubMicah.com Micah Moore Official Web Site].&lt;br /&gt;
*[http://joy-scape.com/ann/10532/Interview+with+Micah+Moore.html Interview] at Adult Industry Press&lt;br /&gt;
*[http://blog.adultdvdtalk.com/2007/01/micah_moore_portland_babes_do.html &amp;quot;MICAH MOORE: Portland Babes Do It Better&amp;quot;], Drew Black, [[January 30]], [[2007]], audio interview at Adult DVD Talk.&lt;br /&gt;
*[http://youtube.com/watch?v=dxGVBCGhrxE Micah Moore attends AEE 2007 on Youtube].&lt;br /&gt;
* [http://www.rogreviews.com/interviews/micah_moore_07.asp &amp;quot;Micah Moore Interview 2007&amp;quot;], by Roger T. Pipe.&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Moore, Micah}}&lt;br /&gt;
[[Category:1987 births]]&lt;br /&gt;
[[Category:Living people]]&lt;br /&gt;
[[Category:American female adult models]]&lt;br /&gt;
[[Category:American porn stars]]&lt;br /&gt;
[[Category:Female porn stars]]&lt;br /&gt;
&lt;br /&gt;
[[it:Micah Moore]]&lt;/div&gt;</summary>
		<author><name>220.233.119.93</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=The_Cookbook/Ph%E1%BB%9F_b%C3%B2&amp;diff=42996</id>
		<title>The Cookbook/Phở bò</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=The_Cookbook/Ph%E1%BB%9F_b%C3%B2&amp;diff=42996"/>
		<updated>2008-04-04T23:31:38Z</updated>

		<summary type="html">&lt;p&gt;220.233.69.205: /* Ingredients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{recipe|Pho bo}} | [[Cookbook:Cuisine of Vietnam|Cuisine of Vietnam]]&lt;br /&gt;
{{recipesummary&lt;br /&gt;
|Category = Vietnamese recipes&lt;br /&gt;
|Image = [[Image:Typicalbeefpho.jpg|300px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Along with [[Cookbook:Phở gà|Phở gà]], &#039;&#039;&#039;Phở bò&#039;&#039;&#039; could easily be called Vietnam&#039;s national dish. Most often served in the early morning, it is available on any street corner, everywhere in Vietnam, all day, and is a staple of most Vietnamese restaurants outside of the country. The broth is the star of this meal and can vary from North to South and is in some cases a closely guarded family secret. Experimenting with the ingredients is a must as long as they are traditionally South-East Asian in origin.&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
;For broth:&lt;br /&gt;
* 2 large white [[Cookbook:Onion|onions]] - chopped into quarters&lt;br /&gt;
* 1 tablespoon of [[Cookbook:Vegetable oil|vegetable]] or [[Cookbook:Peanut Oil|peanut oil]]&lt;br /&gt;
* 5 lbs of [[Cookbook:Beef|beef]] bones (choose ones with a bit of meat on them)&lt;br /&gt;
* 1 small knob of [[Cookbook:Ginger|ginger]] - chopped&lt;br /&gt;
* 2 medium [[Cookbook:Daikon|daikon]] (white radish) - chopped into quarters&lt;br /&gt;
* 1 small [[Cookbook:Cinnamon|cinnamon stick]]&lt;br /&gt;
* 2 [[Cookbook:Cardamom|cardamom]] pods - whole&lt;br /&gt;
* 4 [[Cookbook:Cloves|cloves]] - whole&lt;br /&gt;
* 1 [[Cookbook:Star anise|Star Anise]]&lt;br /&gt;
* 1 tablespoon whole black [[Cookbook:Pepper|peppercorn]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;For serving:&lt;br /&gt;
* Phở noodles (broad rice noodle) - soaked in hot water until soft and drained&lt;br /&gt;
* Finely sliced white onion&lt;br /&gt;
* Finely sliced [[Cookbook:Green onion|scallions]]&lt;br /&gt;
* Chopped [[Cookbook:Cilantro|coriander leaf]]&lt;br /&gt;
* Finely sliced beef sirloin (ask your butcher)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Traditionally, the Vietnamese prefer fatty meat in their soup. Some other serving ingredients include [[w:Tendon|beef tendon]], [[w:Beef shank|beef shank]], [[Cookbook:Tripe|beef tripe]] and meatballs.&lt;br /&gt;
&lt;br /&gt;
;Condiments:&lt;br /&gt;
* [[Cookbook:Chili Pepper|Chili peppers]] - whole&lt;br /&gt;
* [[Cookbook:Bean Sprout|Bean sprouts]]&lt;br /&gt;
* [[Cookbook:Lime|Limes]] - cut into wedges&lt;br /&gt;
* [[Cookbook:Basil|Thai Basil]]&lt;br /&gt;
* [[Cookbook:Fish Sauce|Nước mắm]]&lt;br /&gt;
* [[Cookbook:Hot Sauce|Hot sauce]]&lt;br /&gt;
* [[Cookbook:Hoisin Sauce|Hoisin sauce]]&lt;br /&gt;
* Black pepper&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
# Fry onions in oil until lightly browned. Remove and drain. Rinse the beef bones, place in a stockpot, cover with cold water, and bring slowly to a boil. Reduce heat and simmer, uncovered, for 10-15 minutes. For a clear broth skim off foam.&lt;br /&gt;
# After this initial cooking, add cooked onions, ginger, carrots, cinnamon, cardamom, star anise, cloves, garlic and peppercorns. Bring to a boil again and gently simmer the stock, partially covered, for a minimum of 6 hours but up to 12 hours if you can, skimming regularly. If necessary, add more water to keep the bones covered.&lt;br /&gt;
# Strain stock to remove the vegetable and spices and discard them. Return the broth to the stove to keep it boiling hot.&lt;br /&gt;
&lt;br /&gt;
==Preparing==&lt;br /&gt;
In a large soup bowl, place a handful of cooled Phở noodles, top with thinly sliced raw beef, and ladle on generous amounts of steaming hot broth, which will cook the raw beef. Garnish with sliced onions, scallions and coriander, and serve immediately.&lt;br /&gt;
&lt;br /&gt;
==Serving==&lt;br /&gt;
Place condiments on a large serving plate. It&#039;s not necessary to add any of the condiments to the soup, but adding a few basil leaves, a squeeze of lime, and some bean sprouts, is customary.&lt;br /&gt;
&lt;br /&gt;
Many Vietnamese will also take small bites of very hot chili peppers while eating the soup to spice up the meal. Proceed with caution!&lt;br /&gt;
&lt;br /&gt;
The fish sauce, hot sauce, and hoisin sauce, can either be added directly into the soup or placed in a small bowl for dipping the meat and noodles.&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
[[Category:Beef recipes]]&lt;br /&gt;
[[Category:Vietnamese recipes]]&lt;br /&gt;
[[Category:Noodle recipes]]&lt;br /&gt;
[[Category:Soup recipes]]&lt;/div&gt;</summary>
		<author><name>220.233.69.205</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=The_Cookbook/Ph%E1%BB%9F_b%C3%B2&amp;diff=42995</id>
		<title>The Cookbook/Phở bò</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=The_Cookbook/Ph%E1%BB%9F_b%C3%B2&amp;diff=42995"/>
		<updated>2008-04-04T23:29:56Z</updated>

		<summary type="html">&lt;p&gt;220.233.69.205: /* Ingredients */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{recipe|Pho bo}} | [[Cookbook:Cuisine of Vietnam|Cuisine of Vietnam]]&lt;br /&gt;
{{recipesummary&lt;br /&gt;
|Category = Vietnamese recipes&lt;br /&gt;
|Image = [[Image:Typicalbeefpho.jpg|300px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Along with [[Cookbook:Phở gà|Phở gà]], &#039;&#039;&#039;Phở bò&#039;&#039;&#039; could easily be called Vietnam&#039;s national dish. Most often served in the early morning, it is available on any street corner, everywhere in Vietnam, all day, and is a staple of most Vietnamese restaurants outside of the country. The broth is the star of this meal and can vary from North to South and is in some cases a closely guarded family secret. Experimenting with the ingredients is a must as long as they are traditionally South-East Asian in origin.&lt;br /&gt;
&lt;br /&gt;
==Ingredients==&lt;br /&gt;
;For broth:&lt;br /&gt;
* 2 large white [[Cookbook:Onion|onions]] - chopped into quarters&lt;br /&gt;
* 1 tablespoon of [[Cookbook:Vegetable oil|vegetable]] or [[Cookbook:Peanut Oil|peanut oil]]&lt;br /&gt;
* 5 lbs of [[Cookbook:Beef|beef]] bones (choose ones with a bit of meat on them)&lt;br /&gt;
* 1 small knob of [[Cookbook:Ginger|ginger]] - chopped&lt;br /&gt;
* 2 medium [[Cookbook:Daikon|daikon]] (white radish) - chopped into quarters&lt;br /&gt;
* 1 small [[Cookbook:Cinnamon|cinnamon stick]]&lt;br /&gt;
* 4 [[Cookbook:Cardamom|cardamom]] pods - whole&lt;br /&gt;
* 4 [[Cookbook:Cloves|cloves]] - whole&lt;br /&gt;
* 1 [[Cookbook:Star anise|Star Anise]]&lt;br /&gt;
* 1 tablespoon whole black [[Cookbook:Pepper|peppercorn]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;For serving:&lt;br /&gt;
* Phở noodles (broad rice noodle) - soaked in hot water until soft and drained&lt;br /&gt;
* Finely sliced white onion&lt;br /&gt;
* Finely sliced [[Cookbook:Green onion|scallions]]&lt;br /&gt;
* Chopped [[Cookbook:Cilantro|coriander leaf]]&lt;br /&gt;
* Finely sliced beef sirloin (ask your butcher)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Traditionally, the Vietnamese prefer fatty meat in their soup. Some other serving ingredients include [[w:Tendon|beef tendon]], [[w:Beef shank|beef shank]], [[Cookbook:Tripe|beef tripe]] and meatballs.&lt;br /&gt;
&lt;br /&gt;
;Condiments:&lt;br /&gt;
* [[Cookbook:Chili Pepper|Chili peppers]] - whole&lt;br /&gt;
* [[Cookbook:Bean Sprout|Bean sprouts]]&lt;br /&gt;
* [[Cookbook:Lime|Limes]] - cut into wedges&lt;br /&gt;
* [[Cookbook:Basil|Thai Basil]]&lt;br /&gt;
* [[Cookbook:Fish Sauce|Nước mắm]]&lt;br /&gt;
* [[Cookbook:Hot Sauce|Hot sauce]]&lt;br /&gt;
* [[Cookbook:Hoisin Sauce|Hoisin sauce]]&lt;br /&gt;
* Black pepper&lt;br /&gt;
&lt;br /&gt;
==Procedure==&lt;br /&gt;
&lt;br /&gt;
# Fry onions in oil until lightly browned. Remove and drain. Rinse the beef bones, place in a stockpot, cover with cold water, and bring slowly to a boil. Reduce heat and simmer, uncovered, for 10-15 minutes. For a clear broth skim off foam.&lt;br /&gt;
# After this initial cooking, add cooked onions, ginger, carrots, cinnamon, cardamom, star anise, cloves, garlic and peppercorns. Bring to a boil again and gently simmer the stock, partially covered, for a minimum of 6 hours but up to 12 hours if you can, skimming regularly. If necessary, add more water to keep the bones covered.&lt;br /&gt;
# Strain stock to remove the vegetable and spices and discard them. Return the broth to the stove to keep it boiling hot.&lt;br /&gt;
&lt;br /&gt;
==Preparing==&lt;br /&gt;
In a large soup bowl, place a handful of cooled Phở noodles, top with thinly sliced raw beef, and ladle on generous amounts of steaming hot broth, which will cook the raw beef. Garnish with sliced onions, scallions and coriander, and serve immediately.&lt;br /&gt;
&lt;br /&gt;
==Serving==&lt;br /&gt;
Place condiments on a large serving plate. It&#039;s not necessary to add any of the condiments to the soup, but adding a few basil leaves, a squeeze of lime, and some bean sprouts, is customary.&lt;br /&gt;
&lt;br /&gt;
Many Vietnamese will also take small bites of very hot chili peppers while eating the soup to spice up the meal. Proceed with caution!&lt;br /&gt;
&lt;br /&gt;
The fish sauce, hot sauce, and hoisin sauce, can either be added directly into the soup or placed in a small bowl for dipping the meat and noodles.&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
[[Category:Beef recipes]]&lt;br /&gt;
[[Category:Vietnamese recipes]]&lt;br /&gt;
[[Category:Noodle recipes]]&lt;br /&gt;
[[Category:Soup recipes]]&lt;/div&gt;</summary>
		<author><name>220.233.69.205</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=The_Cookbook/Ph%E1%BB%9F_b%C3%B2&amp;diff=42991</id>
		<title>The Cookbook/Phở bò</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=The_Cookbook/Ph%E1%BB%9F_b%C3%B2&amp;diff=42991"/>
		<updated>2007-07-13T04:50:49Z</updated>

		<summary type="html">&lt;p&gt;220.233.69.205: /* Phở bò */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{recipe|Pho bo}} | [[Cookbook:Cuisine of Vietnam|Cuisine of Vietnam]]&lt;br /&gt;
[[Image:Typicalbeefpho.jpg|thumb|300px|Typical beef &#039;&#039;phở&#039;&#039;]]&lt;br /&gt;
&lt;br /&gt;
==Phở bò==&lt;br /&gt;
&lt;br /&gt;
Along with [[Cookbook:Phở gà|Phở gà]], &#039;&#039;&#039;Phở bò&#039;&#039;&#039; could easily be called Vietnam&#039;s national dish. Most often served in the early morning, it is available on any street corner, everywhere in Vietnam, all day, and is a staple of most Vietnamese restaurants outside of the country. The broth is the star of this meal and can vary from North to South and is in some cases a closely guarded family secret. Experimenting with the ingredients is a must as long as they are traditionally South-East Asian in origin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ingredients for broth:&#039;&#039;&#039;&lt;br /&gt;
* 2 large white onions - chopped into quarters&lt;br /&gt;
* 1 tablespoon of vegetable or peanut oil&lt;br /&gt;
* 5 lbs of beef bones (choose ones with a bit of meat on them)&lt;br /&gt;
* 1 small knob of [[Cookbook:Ginger|ginger]] - chopped&lt;br /&gt;
* 2 medium daikon (white raddish) - chopped into quarters&lt;br /&gt;
* 1 small [[Cookbook:Cinnamon|cinnamon stick]]&lt;br /&gt;
* 4 [[Cookbook:Cardamom|cardamom]] pods - whole&lt;br /&gt;
* 4 [[Cookbook:Cloves|cloves]] - whole&lt;br /&gt;
* 1 [[Cookbook:Star Anise|Star Anise]]&lt;br /&gt;
* 1 tablespoon whole black peppercorn&lt;br /&gt;
* 2 garlic cloves - peeled&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Serving ingredients:&#039;&#039;&#039;&lt;br /&gt;
* Phở noodles (broad rice noddle) - soaked in hot water until soft and drained&lt;br /&gt;
* Finely sliced white onion&lt;br /&gt;
* Finely sliced [[Cookbook:Scallion|scallions]]&lt;br /&gt;
* Chopped [[Cookbook:Coriander|coriander]]&lt;br /&gt;
* Finely sliced beef sirloin (ask your butcher)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Traditionally, the Vietnamese prefer fatty meat in their soup. Some other serving ingredients include [http://en.wikipedia.org/wiki/Tendon beef tendon], [http://en.wikipedia.org/wiki/Beef_shank beef shank], [http://en.wikipedia.org/wiki/Tripe beef tripe] and meatballs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Condiments:&#039;&#039;&#039;&lt;br /&gt;
* [[Cookbook:Chili Pepper|Chili peppers]] - whole&lt;br /&gt;
* [[Cookbook:Bean sprouts|Bean sprouts]]&lt;br /&gt;
* [[Cookbook:Lime|Limes]] - cut into wedges&lt;br /&gt;
* [[Cookbook:Basil|Thai Basil]]&lt;br /&gt;
* [[Cookbook:Fish Sauce|Nuoc mam]]&lt;br /&gt;
* [[Cookbook:Hot Sauce|Hot sauce]]&lt;br /&gt;
* [[Cookbook:Hoisin Sauce|Hoisin sauce]]&lt;br /&gt;
* Black pepper&lt;br /&gt;
&lt;br /&gt;
==Directions==&lt;br /&gt;
&lt;br /&gt;
Fry onions in oil until lightly browned. Remove and drain. Rinse the beef bones, place in a stockpot, cover with cold water, and bring slowly to a boil. Reduce heat and simmer, uncovered, for 10-15 minutes. For a clear broth skim off foam.&lt;br /&gt;
&lt;br /&gt;
After this initial cooking, add cooked onions, ginger, carrots, cinnamon, cardamom, star anise, cloves, garlic and peppercorns. Bring to a boil again and gently simmer the stock, partially covered, for a minimum of 6 hours but up to 12 hours if you can, skimming regularly. If necessary, add more water to keep the bones covered.&lt;br /&gt;
&lt;br /&gt;
Strain stock to remove the vegetable and spices and discard them. Return the broth to the stove to keep it boiling hot.&lt;br /&gt;
&lt;br /&gt;
==Preparing==&lt;br /&gt;
In a large soup bowl, place a handful of cooled Phở noodles, top with thinly sliced raw beef, and ladle on generous amounts of steaming hot broth, which will cook the raw beef. Garnish with sliced onions, scallions and coriander, and serve immediately.&lt;br /&gt;
&lt;br /&gt;
==Serving==&lt;br /&gt;
Place condiments on a large serving plate. It&#039;s not necessary to add any of the condiments to the soup, but adding a few basil leaves, a squeeze of lime, and some bean sprouts, is customary.&lt;br /&gt;
&lt;br /&gt;
Many Vietnamese will also take small bites of very hot chili peppers while eating the soup to spice up the meal. Proceed with caution!&lt;br /&gt;
&lt;br /&gt;
The fish sauce, hot sauce, and hoisin sauce, can either be added directly into the soup or placed in a small bowl for dipping the meat and noodles.&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
[[Category:Beef recipes|Pho bo]]&lt;br /&gt;
[[Category:Vietnamese recipes|Pho bo]]&lt;br /&gt;
[[Category:Noodle recipes|Pho bo]]&lt;br /&gt;
[[Category:Soup recipes|Pho bo]]&lt;/div&gt;</summary>
		<author><name>220.233.69.205</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37975</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37975"/>
		<updated>2007-05-28T01:54:51Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 1 - Lexical Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 document.write(&amp;quot;We are going to see if a=4 &amp;amp;lt;br /&amp;amp;gt;&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37974</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37974"/>
		<updated>2007-05-28T01:53:59Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 2 - Syntactic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 document.write(&amp;quot;We are going to see if a=4 &amp;amp;lt;br /&amp;amp;gt;&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37973</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37973"/>
		<updated>2007-05-28T01:53:36Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 document.write(&amp;quot;We are going to see if a=4 &amp;amp;lt;br /&amp;amp;gt;&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
   document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37972</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37972"/>
		<updated>2007-05-28T01:52:44Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 document.write(&amp;quot;We are going to see if a=4 &amp;amp;lt;br /&amp;amp;gt;&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37971</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37971"/>
		<updated>2007-05-28T01:50:49Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 document.write(&amp;quot;We are going to see if a=4&amp;quot;+&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37970</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37970"/>
		<updated>2007-05-28T01:50:08Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 document.write(&amp;quot;We are going to see if a=4&amp;quot;+&amp;quot;\n&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37969</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37969"/>
		<updated>2007-05-28T00:38:19Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 3 - Execution Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37968</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37968"/>
		<updated>2007-05-28T00:37:47Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 3 - Execution Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;amp;lt;br&amp;amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37967</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37967"/>
		<updated>2007-05-21T05:00:55Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 3 - Execution Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
   document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
   for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
   {&lt;br /&gt;
    document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;lt;br&amp;gt;&amp;quot;)&lt;br /&gt;
    }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = prompt(&amp;quot;Write a number&amp;quot;, &#039; &#039;);//try number 10&lt;br /&gt;
    var num2 = 10;&lt;br /&gt;
    if( num1 &amp;gt; num2 ){&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is less than 10&amp;quot;);&lt;br /&gt;
    }else{&lt;br /&gt;
    document.write(&amp;quot;The number you wrote&amp;quot; +num1+ &amp;quot; is more than 10&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37966</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37966"/>
		<updated>2007-05-21T04:32:07Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
 document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
 for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
 {&lt;br /&gt;
  document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;lt;br&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected, usually because you haven&#039;t considered the data being processed. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37965</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37965"/>
		<updated>2007-05-21T04:30:43Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 3 - Execution Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors occur when the program has the correct syntax and lexicon, but you&#039;re making the wrong requests to get the results you desire. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=text/javascript&amp;gt;&lt;br /&gt;
 document.write(&amp;quot;Show the factorials from 1 to 10&amp;quot;)&lt;br /&gt;
 for (i=1,fact=1;i&amp;lt;11;i++,fact*=i); &lt;br /&gt;
 {&lt;br /&gt;
  document.write(i+&amp;quot;!=&amp;quot;+fact+&amp;quot;&amp;lt;br&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37964</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37964"/>
		<updated>2007-05-21T04:25:49Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;amp;lt;br /&amp;amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37963</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37963"/>
		<updated>2007-05-21T04:25:01Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 3 - Execution Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
    &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  //If the time is less than 10,&lt;br /&gt;
  //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
6&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new Date()&lt;br /&gt;
     (var time = d.getHours()&lt;br /&gt;
   if (time &amp;lt; 10) &lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   else&lt;br /&gt;
   {&lt;br /&gt;
   document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
   }&lt;br /&gt;
   &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
     }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 		&lt;br /&gt;
 var d = new Date();&lt;br /&gt;
 &lt;br /&gt;
 function saygidday() {&lt;br /&gt;
  var d;&lt;br /&gt;
  var time = d.getHours();&lt;br /&gt;
  if(time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37960</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37960"/>
		<updated>2007-05-21T04:21:23Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37959</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37959"/>
		<updated>2007-05-21T04:19:54Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 1 - Lexical Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37958</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37958"/>
		<updated>2007-05-21T04:19:21Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 1 - Lexical Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
4&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
     var d = new date()&lt;br /&gt;
     var time = d.getHours()&lt;br /&gt;
  if (time &amp;lt; 10) &lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good morning&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
  document.write(&amp;quot;&amp;lt;b&amp;gt;Good day&amp;lt;/b&amp;gt;&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a:2;&lt;br /&gt;
 var b:3;&lt;br /&gt;
 var c:4;&lt;br /&gt;
 if(a&amp;gt;b &amp;amp;&amp;amp; b&amp;gt;c || c&amp;gt;a)&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;C is the largest, followed by B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	alert(&amp;quot;I am unsure what happened&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37956</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37956"/>
		<updated>2007-05-21T04:14:33Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 2 - Syntactic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37955</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37955"/>
		<updated>2007-05-21T04:12:48Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	 document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
5&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 function startTime()&lt;br /&gt;
 {&lt;br /&gt;
 var today=new Date()&lt;br /&gt;
 var h=today.getHours()&lt;br /&gt;
 var m=today.getMinutes()&lt;br /&gt;
 var s=today.getSeconds()&lt;br /&gt;
 // add a zero in front of numbers&amp;lt;10&lt;br /&gt;
 m=checkTime(m)&lt;br /&gt;
 s=checkTime(s)&lt;br /&gt;
 document.getelementById(&#039;txt&#039;).innerHTML=h+&amp;quot;:&amp;quot;+m+&amp;quot;:&amp;quot;+s&lt;br /&gt;
 t=settimeout(&#039;startTime()&#039;,500)&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 function checkTime(i)&lt;br /&gt;
 {&lt;br /&gt;
 if (i&amp;lt;10) &lt;br /&gt;
   {i=&amp;quot;0&amp;quot; + i}&lt;br /&gt;
   return i&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;body onload=&amp;quot;startTime()&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var a=2;&lt;br /&gt;
 alert(&amp;quot;We are going to see if a=4&amp;quot;);&lt;br /&gt;
 if(a=4)&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;Yes, variable a does equal 4&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
 	document.write(&amp;quot;No, variable a does not equal 4&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37953</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37953"/>
		<updated>2007-05-21T04:08:03Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	 document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 var i=0&lt;br /&gt;
 for (i=0;i&amp;lt;=10;i++)&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;The number is &amp;quot; == i)&lt;br /&gt;
 document.write(&amp;quot;&amp;lt;br /&amp;gt;&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37952</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37952"/>
		<updated>2007-05-21T04:05:06Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 2 - Syntactic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //Is the variable a equal to or greater than b?&lt;br /&gt;
 var a=8;&lt;br /&gt;
 var b=2;&lt;br /&gt;
 //It seems so, lets check!&lt;br /&gt;
 if(a=&amp;gt;b)&lt;br /&gt;
 {&lt;br /&gt;
 	 document.write(&amp;quot;Yes, A is equal to or greater than B&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37951</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37951"/>
		<updated>2007-05-21T04:03:10Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 1 - Lexical Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   var x = 0;&lt;br /&gt;
   var y = hello;&lt;br /&gt;
   alert(&amp;quot;first valuable is&amp;quot; + x + &amp;quot;second valuable is&amp;quot; + y)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37950</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37950"/>
		<updated>2007-05-21T04:01:00Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 2 - Syntactic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  var txt=&amp;quot;We are the so-called  &amp;quot;Vikings&amp;quot; from the north.&amp;quot;&lt;br /&gt;
  document.write(txt)&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37949</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37949"/>
		<updated>2007-05-21T03:59:12Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 2 - Syntactic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
 //If the time is less than 10,&lt;br /&gt;
 //you will get a &amp;quot;Good morning&amp;quot; greeting.&lt;br /&gt;
 //Otherwise you will get a &amp;quot;Good day&amp;quot; greeting.&lt;br /&gt;
 var d = new Date()&lt;br /&gt;
 var time = d.getHours()&lt;br /&gt;
 else(time &amp;lt; 10) &lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good morning!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 if&lt;br /&gt;
 {&lt;br /&gt;
 document.write(&amp;quot;Good day!&amp;quot;)&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37948</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37948"/>
		<updated>2007-05-21T03:56:50Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 1 - Lexical Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
1&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
  function display message()&lt;br /&gt;
  {&lt;br /&gt;
    alert(&amp;quot;Hello World!&amp;quot;)&lt;br /&gt;
  }&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Click me!&amp;quot; onclick=&amp;quot;displaymessage()&amp;quot; &amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37947</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37947"/>
		<updated>2007-05-21T03:46:03Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 3 - Execution Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;, &amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37946</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37946"/>
		<updated>2007-05-21T03:45:22Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected. These are the hardest errors to spot, and often the most expensive to correct.&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37945</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37945"/>
		<updated>2007-05-21T03:44:29Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge 3 - Execution Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37944</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37944"/>
		<updated>2007-05-21T03:43:57Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge 2 - Syntactic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge Set 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Challenge 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37943</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37943"/>
		<updated>2007-05-21T03:02:20Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Challenge 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i + &#039; &#039;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37942</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37942"/>
		<updated>2007-05-21T03:01:56Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge 4 - Logic Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Challenge 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    document.write(&amp;quot;counting from 1 to 10... &amp;quot;);&lt;br /&gt;
    for (i=1; i&amp;lt;11; i+=1)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(++i);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37941</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37941"/>
		<updated>2007-05-21T02:00:20Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge Set 1 - Lexical Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Challenge 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected&lt;br /&gt;
&lt;br /&gt;
TODO - add more examples of each&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
	<entry>
		<id>https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37940</id>
		<title>Archive:Debugging challenges</title>
		<link rel="alternate" type="text/html" href="https://ideawaza.com/index.php?title=Archive:Debugging_challenges&amp;diff=37940"/>
		<updated>2007-05-21T01:59:37Z</updated>

		<summary type="html">&lt;p&gt;220.233.23.195: /* Challenge 1 - Lexical Errors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These debugging challenges are written in JavaScript, and designed to complement the units: [[ICAB4225A Automate processes]] and [[ICAT4221A Locate equipment, system and software faults]]&lt;br /&gt;
== Challenge Set 1 - Lexical Errors ==&lt;br /&gt;
Lexical errors are introduced when the programmer enters symbols that are not part of the programming language. Unlike when you misspell a word in English, this inevitably leads to a breakdown in programming communications. See if you can see (or find) the lexical errors in the following code snippets...&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var num1 = 2;&lt;br /&gt;
    var num2 = 3;&lt;br /&gt;
    var product = num1 x num2;&lt;br /&gt;
    alert(&amp;quot;the product of &amp;quot; + num1 + &amp;quot; and &amp;quot; + num2 + &amp;quot; is &amp;quot; + product);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
	/* This script and many more are available free online at&lt;br /&gt;
	The JavaScript Source!! http://javascript.internet.com&lt;br /&gt;
	Created by: Patrick Fitzgerald | http://www.barelyfitz.com/ */&lt;br /&gt;
	function truncate() {&lt;br /&gt;
	  var len = 100;&lt;br /&gt;
	  var p = document.getElementByID(&#039;truncateMe&#039;);&lt;br /&gt;
	  if (p) {&lt;br /&gt;
	    var trunc = p.innerHTML;&lt;br /&gt;
	    if (trunc.length &amp;gt; len) {&lt;br /&gt;
&lt;br /&gt;
	      /* Truncate the content of the P, then go back to the end of the&lt;br /&gt;
		 previous word to ensure that we don&#039;t truncate in the middle of&lt;br /&gt;
		 a word */&lt;br /&gt;
	      trunc = trunc.substring(0, len);&lt;br /&gt;
	      trunc = trunc.replace(/\w+$/, &#039;&#039;);&lt;br /&gt;
&lt;br /&gt;
	      /* Add an ellipses to the end and make it a link that expands&lt;br /&gt;
		 the paragraph back to its original size */&lt;br /&gt;
	      trunc += &#039;&amp;lt;a href=&amp;quot;#&amp;quot; &#039; +&lt;br /&gt;
		&#039;onclick=&amp;quot;this.parentNode.innerHTML=&#039; +&lt;br /&gt;
		&#039;unescape(\&#039;&#039;+escape(p.innerHTML)+&#039;\&#039;);return false;&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
		&#039;&amp;lt;span style=&amp;quot;font-size: 10px;&amp;quot;&amp;gt;[ more ... ]&amp;lt;/span&amp;gt;&amp;lt;\/a&amp;gt;&#039;;&lt;br /&gt;
	      p.innerHTML = trunc;&lt;br /&gt;
	    }&lt;br /&gt;
	  }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Multiple onload function created by: Simon Willison&lt;br /&gt;
	// http://simon.incutio.com/archive/2004/05/26/addLoadEvent&lt;br /&gt;
	function addLoadEvent(func) {&lt;br /&gt;
	  var oldonload = window.onload;&lt;br /&gt;
	  if (typeof window.onload != &#039;function&#039;) {&lt;br /&gt;
	    window.onload = func;&lt;br /&gt;
	  } else {&lt;br /&gt;
	    window.onload = function() {&lt;br /&gt;
	      if (oldonload) {&lt;br /&gt;
		oldonload();&lt;br /&gt;
	      }&lt;br /&gt;
	      func();&lt;br /&gt;
	    }&lt;br /&gt;
	  }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	addLoadEvent(function() {&lt;br /&gt;
	  truncate();&lt;br /&gt;
	});&lt;br /&gt;
	&amp;lt;/script&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;p id=&amp;quot;truncateMe&amp;quot;&amp;gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean consectetuer. Etiam venenatis. Sed ultricies, pede sit amet aliquet lobortis&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 2 - Syntactic Errors ==&lt;br /&gt;
A syntax error occurs when you use the right symbols, but in a way that doesn&#039;t make sense to the compiler or interpreter. Something like the English sentence: &amp;quot;You don&#039;t program good&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var x;&lt;br /&gt;
    x=prompt(&amp;quot;What is 5 x 5?&amp;quot;);&lt;br /&gt;
    while (x != 25) do&lt;br /&gt;
    {&lt;br /&gt;
      alert(&amp;quot;Wrong answer&amp;quot;);&lt;br /&gt;
      x=prompt(&amp;quot;What is 5 x 5?&amp;quot;,0);&lt;br /&gt;
    }&lt;br /&gt;
    document.write(&amp;quot;Right, the answer is &amp;quot; + x)&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Challenge 3 - Execution Errors ==&lt;br /&gt;
Execution errors are impossible requests made in perfectly correct programming terms. &lt;br /&gt;
&lt;br /&gt;
  &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
    var weekdays=new Array(&amp;quot;Sunday&amp;quot;,&amp;quot;Monday&amp;quot;,&amp;quot;Tuesday&amp;quot;,&amp;quot;Wednesday&amp;quot;,&amp;quot;Thursday&amp;quot;,&amp;quot;Friday&amp;quot;,&amp;quot;Saturday&amp;quot;)&lt;br /&gt;
    for (i=1; i&amp;lt;8; ++i)&lt;br /&gt;
    {&lt;br /&gt;
      document.write(weekdays[i] + &amp;quot;&amp;lt;br /&amp;gt;&amp;quot;);&lt;br /&gt;
    }    &lt;br /&gt;
  &amp;lt;/script&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Challenge 4 - Logic Errors ==&lt;br /&gt;
These are errors introduced Through faulty design. Once again, the syntax is correct, but the results are unexpected&lt;br /&gt;
&lt;br /&gt;
TODO - add more examples of each&lt;/div&gt;</summary>
		<author><name>220.233.23.195</name></author>
	</entry>
</feed>