<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5604649628460881387</id><updated>2012-02-16T01:06:06.800-06:00</updated><category term='Seminar on Hacking'/><category term='Cyber Security and Computer Ethics'/><category term='Computer N/W Security and Cyber Ethics Ch-5'/><category term='Beyond Fear Chapter-2'/><category term='Computer Privacy'/><category term='Javascript'/><category term='Beyond Fear Chapter-1'/><category term='Google'/><category term='Midterm Questions and Answers on Computer Security'/><category term='T-Mobile Samsung Behold'/><category term='Computer N/W Security and Cyber Ethics Ch-4'/><category term='Beyond Fear Chapter-3'/><title type='text'>Computer Science,Computer Security, GSM Cell Phones and Latest Technolgy Blog</title><subtitle type='html'>This is the site for computer science related technology, programming languages, JAVA, ASP.net, Java Beans and servelet, Oracle procedures and triggers, SQL, Computer Security, Networking, Hacking related articles.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-7287159514906626180</id><published>2008-11-23T21:37:00.001-06:00</published><updated>2008-11-23T21:37:36.920-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Privacy and Google Search Engine Indexing</title><content type='html'>&lt;div style="width:425px;text-align:left" id="__ss_781753"&gt;&lt;a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/bewise/privacy-and-search-engine-indexing-presentation?type=powerpoint" title="Privacy and Search Engine Indexing"&gt;Privacy and Search Engine Indexing&lt;/a&gt;&lt;object style="margin:0px" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=slideshareprivacy-1227497483467460-9&amp;stripped_title=privacy-and-search-engine-indexing-presentation" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=slideshareprivacy-1227497483467460-9&amp;stripped_title=privacy-and-search-engine-indexing-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;"&gt;View SlideShare &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/bewise/privacy-and-search-engine-indexing-presentation?type=powerpoint" title="View Privacy and Search Engine Indexing on SlideShare"&gt;presentation&lt;/a&gt; or &lt;a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint"&gt;Upload&lt;/a&gt; your own. (tags: &lt;a style="text-decoration:underline;" href="http://slideshare.net/tag/engine"&gt;engine&lt;/a&gt; &lt;a style="text-decoration:underline;" href="http://slideshare.net/tag/search"&gt;search&lt;/a&gt;)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-7287159514906626180?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/7287159514906626180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=7287159514906626180' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7287159514906626180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7287159514906626180'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/privacy-and-google-search-engine.html' title='Privacy and Google Search Engine Indexing'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-1985177077878317953</id><published>2008-11-19T21:27:00.006-06:00</published><updated>2008-11-19T21:47:55.992-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Google'/><title type='text'>Twenty Google Tools for Boosting Your Productivity</title><content type='html'>Google has extended far beyond its core search business to provide a variety of new services, including free email, Web hosting, and business applications. It only makes sense to pay attention to what Google has to offer and take advantage of the services that can help you. Google is constantly expanding its services and acquiring new technologies.There is also the important matter of your time and energy. The truth is that if you look through all of the services and utilities made available by Google (a list that seems to grow all the time), you’ll find many more than 20 tools. Learning to make the most of what these services have to offer can make a difference to anyone wanting to get a new online business off the ground or improve the reach and success level of an existing small- to medium-size company. Here is a list of 20 of the tools you’re likely to find most useful:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1.&lt;/strong&gt; &lt;strong&gt;Google’s search service.&lt;/strong&gt; Google indexes and organizes the contents of the Web in a huge database; it’s this database that you use to search the Web.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. AdWords.&lt;/strong&gt; This is a paid search placement program; you create ads and bid on how much you’ll pay for each click the ad attracts. Each time someone&lt;br /&gt;clicks on your ad, you gain a potential customer or client.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;3. AdSense.&lt;/strong&gt; This program enables blog and Web site owners to run targeted ads alongside their content; the content of the ads is intended to complement what you’ve published yourself .&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;4. Google Apps.&lt;/strong&gt; This service provides you with a domain name (for a one-time $10 fee) and enables you to use a suite of business applications, which multiple users can access.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;5. Google Docs &amp;amp; Spreadsheets.&lt;/strong&gt; This exciting and easy-to-use service gives you a word processor and a spreadsheet application that you can use and access for free.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;6. Google Calendar&lt;/strong&gt;. A default calendar is created for you when you sign up for Google Apps; you can also create custom calendars and even embed calendars in Web pages.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;7. Gmail.&lt;/strong&gt; Google’s e-mail application comes with lots of storage space and an integrated chat client to boot.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;8. Google Talk.&lt;/strong&gt; Google’s chat application lets you send instant messages and even conduct real-time voice conversations through your computer.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;9. Google Page Creator.&lt;/strong&gt; This Web page editing tool lets you create your own Web site to go along with your Google Apps domain name.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;10. Blogger.&lt;/strong&gt; Google’s popular, and free, blogging services lets you create your own Web-based diary, complete with an index, an archive, and a comments feature.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;11. Checkout, Google Product Search, Catalogs.&lt;/strong&gt; These three Google services help commercial businesses sell products online.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;12. Google Base.&lt;/strong&gt; A growing number of entrepreneurs are posting merchandise, property, services, jobs, and lots of other things for sale in this Web publishing area.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;13. Google Gadgets.&lt;/strong&gt; These easy-to-implement bits of Web content can make your Web site more valuable and attract more repeat visits.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;14. Analytics, Trends.&lt;/strong&gt; These two analytical tools provide you with information about visits to your own Web site and trends in Web searches, respectively.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;15. Desktop, Toolbar.&lt;/strong&gt; These two tools help you search more effectively, both through files on your own computer and your local network (Desktop) as well as the wider Internet (Toolbar).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;16. Picasa.&lt;/strong&gt; This powerful photo viewing and editing tool automatically organizes all the files on your desktop and lets you edit them as well.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;17. News, Book Search.&lt;/strong&gt; These tools provide businesspeople with important up-to the-minute data they need to keep on top of trends and events.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;18. Google Apps Premium.&lt;/strong&gt; This corporate version of Google Apps guarantees nearly 24/7 reliability and gives businesses the ability to write custom programs that interface with Google’s services.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;19. Gmail Mobile and SMS.&lt;/strong&gt; These tools let busy professionals search Google and exchange messages when they’re on the road.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;20. Google Pack.&lt;/strong&gt; This suite of applications will boost the functionality of virtually any workstation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-1985177077878317953?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/1985177077878317953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=1985177077878317953' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1985177077878317953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1985177077878317953'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/twenty-google-tools-for-boosting-your.html' title='Twenty Google Tools for Boosting Your Productivity'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-6789666290416735450</id><published>2008-11-14T23:57:00.001-06:00</published><updated>2008-11-14T23:57:57.408-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Puzzle</title><content type='html'>(15 Puzzle) Write a web page that enables the user to play the game of 15. There is a 4-by-4 board (implemented as an XHTML table) for a total of 16 slots. One of the slots is empty. The other slots are occupied by 15 tiles, randomly numbered from 1 through 15. Any tile next to the currently empty slot can be moved into the currently empty slot by clicking on the tile. Your program should create the board with the tiles out of order. The user's goal is to arrange the tiles in sequential order row by row. Using the DOM and the onclick event, write a script that allows the user to swap the positions of the open position and an adjacent tile. [Hint: The onclick event should be specified for each table cell.]&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;puzzle&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function puzzle()&lt;br /&gt;{&lt;br /&gt;for(var i = 0; i &amp;lt; 500; i++)&lt;br /&gt;{&lt;br /&gt;var moves = new Array(); // The set of valid moves&lt;br /&gt;var pos = 0; // The number of candidate valid moves&lt;br /&gt;/* Find blank */&lt;br /&gt;for(var blankpos = 0; blankpos&amp;lt; 16; blankpos++)&lt;br /&gt;{&lt;br /&gt;if(slot(blankpos).innerText == "0")&lt;br /&gt;{&lt;br /&gt;/* Find moves */&lt;br /&gt;if((blankpos % 4) &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;moves[pos++] = blankpos - 1; // Left&lt;br /&gt;}&lt;br /&gt;if((blankpos % 4) &amp;lt; 3)&lt;br /&gt;{&lt;br /&gt;moves[pos++] = blankpos + 1; // Right&lt;br /&gt;}&lt;br /&gt;if(blankpos &amp;gt; 3)&lt;br /&gt;{&lt;br /&gt;moves[pos++] = blankpos - 4; // Up&lt;br /&gt;}&lt;br /&gt;if(blankpos &amp;lt; 12)&lt;br /&gt;{&lt;br /&gt;moves[pos++] = blankpos + 4; // Down&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/* Move random candidate */&lt;br /&gt;moveSlot(moves[(Math.floor(Math.random() * moves.length))]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;function moveSlot(pos)&lt;br /&gt;{&lt;br /&gt;var move = -1; // The cell to which to move&lt;br /&gt;if((pos % 4) &amp;gt; 0 &amp;amp;&amp;amp; slot(pos - 1).innerText == "0")&lt;br /&gt;{&lt;br /&gt;move = pos - 1; // Left&lt;br /&gt;}&lt;br /&gt;if((pos % 4) &amp;lt; 3 &amp;amp;&amp;amp; slot(pos + 1).innerText == "0")&lt;br /&gt;{&lt;br /&gt;move = pos + 1; // Right&lt;br /&gt;}&lt;br /&gt;if(pos &amp;gt; 3 &amp;amp;&amp;amp; slot(pos - 4).innerText == "0")&lt;br /&gt;{&lt;br /&gt;move = pos - 4; // Up&lt;br /&gt;}&lt;br /&gt;if(pos &amp;lt; 12 &amp;amp;&amp;amp; slot(pos + 4).innerText == "0")&lt;br /&gt;{&lt;br /&gt;move = pos + 4; // Down&lt;br /&gt;}&lt;br /&gt;if(move &amp;gt; -1)&lt;br /&gt;{&lt;br /&gt;slot(move).innerText = slot(pos).innerText;&lt;br /&gt;slot(move).className = slot(pos).className;&lt;br /&gt;slot(pos).innerText = "0";&lt;br /&gt;slot(pos).className = "blankpos";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;b&lt;br /&gt;{&lt;br /&gt;font-size:100;&lt;br /&gt;display:inline;&lt;br /&gt;height:60;&lt;br /&gt;width:60;&lt;br /&gt;}&lt;br /&gt;.blankpos&lt;br /&gt;{&lt;br /&gt;display:none;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;p.c2&lt;br /&gt;{&lt;br /&gt;text-align:center;&lt;br /&gt;}&lt;br /&gt;button.c1&lt;br /&gt;{&lt;br /&gt;font-size:20;&lt;br /&gt;width:160;&lt;br /&gt;}&lt;br /&gt;.style1 {&lt;br /&gt;color: #000066;&lt;br /&gt;font-weight: bold;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;table style="width: 100%" border="0" cellpadding="0" cellspacing="0"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td valign="top"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Puzzle&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;(15 Puzzle) Write a web page that enables the user to play the game of 15. There is a 4-by-4 board (implemented as an XHTML table) for a total of 16 slots. One of the slots is empty. The other slots are occupied by 15 tiles, randomly numbered from 1 through 15. Any tile next to the currently empty slot can be moved into the currently empty slot by clicking on the tile. Your program should create the board with the tiles out of order. The user's goal is to arrange the tiles in sequential order row by row. Using the DOM and the onclick event, write a script that allows the user to swap the positions of the open position and an adjacent tile. [Hint: The onclick event should be specified for each table cell.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;table border="1" align="center" bgcolor="pink"&amp;gt;&lt;br /&gt;&amp;lt;center&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(0)"&amp;gt;01 &amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(1)"&amp;gt;02&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(2)"&amp;gt;03&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(3)"&amp;gt;04&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/center&amp;gt;&lt;br /&gt;&amp;lt;center&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(4)"&amp;gt;05&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(5)"&amp;gt;06&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(6)"&amp;gt;07&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(7)"&amp;gt;08&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/center&amp;gt;&lt;br /&gt;&amp;lt;center&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(8)"&amp;gt;09&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(9)"&amp;gt;10&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(10)"&amp;gt;11&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(11)"&amp;gt;12&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/center&amp;gt;&lt;br /&gt;&amp;lt;center&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(12)"&amp;gt;13&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(13)"&amp;gt;14&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="b" onclick="moveSlot(14)"&amp;gt;15&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;button id="slot" class="blankpos" onclick="moveSlot(15)"&amp;gt;0&amp;lt;/button&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/center&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;p class="c2"&amp;gt;&amp;lt;button onclick="puzzle()" class="c1"&amp;gt;New Game&amp;lt;/button&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-6789666290416735450?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/6789666290416735450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=6789666290416735450' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6789666290416735450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6789666290416735450'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-puzzle.html' title='Javascript Puzzle'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-5649117011580251394</id><published>2008-11-14T23:54:00.000-06:00</published><updated>2008-11-14T23:55:26.327-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Creating a Sentence</title><content type='html'>Write a script that uses random number generation to create sentences. Use four arrays of strings called article, noun, verb and preposition. Create a sentence by selecting a word at random from each array in the following order: article, noun, verb, preposition, article and noun. As each word is picked, concatenate it to the previous words in the sentence. The words should be separated by spaces. When the final sentence is output, it should start with a capital letter and end with a period.&lt;br /&gt;The arrays should be filled as follows: the article array should contain the articles "the", "a", "one", "some" and "any"; the noun array should contain the nouns "boy", "girl", "dog", "town" and "car"; the verb array should contain the verbs "drove", "jumped", "ran", "walked" and "skipped"; the preposition array should contain the prepositions "to", "from", "over", "under" and "on".&lt;br /&gt;The program should generate 20 sentences to form a short story and output the result to an XHTML textarea. The story should begin with a line reading "Once upon a time..." and end with a line reading "THE END".&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Sentences&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function sentence()&lt;br /&gt;{&lt;br /&gt;var i;&lt;br /&gt;var article= new Array(5);&lt;br /&gt;article[0]="the";&lt;br /&gt;article[1]="a";&lt;br /&gt;article[2]="one";&lt;br /&gt;article[3]="some";&lt;br /&gt;article[4]="any";&lt;br /&gt;var noun= new Array(5);&lt;br /&gt;noun[0]="boy";&lt;br /&gt;noun[1]="girl";&lt;br /&gt;noun[2]="dog";&lt;br /&gt;noun[3]="town";&lt;br /&gt;noun[4]="car";&lt;br /&gt;var verb= new Array(5);&lt;br /&gt;verb[0]="drove";&lt;br /&gt;verb[1]="jumped";&lt;br /&gt;verb[2]="ran";&lt;br /&gt;verb[3]="walked";&lt;br /&gt;verb[4]="skipped";&lt;br /&gt;var preposition= new Array(5);&lt;br /&gt;preposition[0]="to";&lt;br /&gt;preposition[1]="from";&lt;br /&gt;preposition[2]="over";&lt;br /&gt;preposition[3]="under";&lt;br /&gt;preposition[4]="on";&lt;br /&gt;var string1="Once upon a time..." ;&lt;br /&gt;for(i = 0; i &amp;lt; 20; i++)&lt;br /&gt;{&lt;br /&gt;string1 = string1 + caps(article[Math.floor(Math.random()*5)]) + " " + noun[Math.floor(Math.random()*5)] + " " + verb[Math.floor(Math.random()*5)] + " " + preposition[Math.floor(Math.random()*5)] + " " + article[Math.floor(Math.random()*5)] + " " + noun[Math.floor(Math.random()*5)] + "." + "\n";&lt;br /&gt;}&lt;br /&gt;var string2="THE END";&lt;br /&gt;document.writeln(string1 + string2);&lt;br /&gt;}&lt;br /&gt;function caps(a)&lt;br /&gt;{&lt;br /&gt;var first= a.substring(0,1);&lt;br /&gt;var last= a.substring(1);&lt;br /&gt;var output= first.toUpperCase() + last;&lt;br /&gt;return output;&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body onload="sentence()"&amp;gt;&lt;br /&gt;&amp;lt;table style="width: 100%" border="0" cellpadding="0" cellspacing="0"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td valign="top"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Exercise 11.7 Sentences&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program to Output sentences.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-5649117011580251394?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/5649117011580251394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=5649117011580251394' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5649117011580251394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5649117011580251394'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-creating-sentence.html' title='Javascript Creating a Sentence'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-5345691941867886226</id><published>2008-11-14T23:52:00.000-06:00</published><updated>2008-11-14T23:53:40.139-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript String Tokenizer for Reverse Strings</title><content type='html'>&lt;p&gt;Write a script that inputs a line of text, tokenizes it with String method split and outputs the tokens in reverse order.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; ReverseThem &amp;lt;/title&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function splitButtonPressed()&lt;br /&gt;{&lt;br /&gt;var inputString = document.getElementById( "string1" ).value;&lt;br /&gt;var tokens = inputString.split( " " );&lt;br /&gt;var len=tokens.length;&lt;br /&gt;var reverse="";&lt;br /&gt;for(i=len-1; i&amp;gt;=0; i--)&lt;br /&gt;{&lt;br /&gt;reverse= reverse +" " + tokens[i];&lt;br /&gt;}&lt;br /&gt;document.getElementById( "ans" ).value = reverse;&lt;br /&gt;} // end function splitButtonPressed&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;table style="width: 100%" border="0" cellpadding="0" cellspacing="0"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td valign="top"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt; Reverse Them&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program to Reverse Input strings using Split.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "ReverseThem" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Compare&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Enter any String to Reverse&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "string1" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Output String&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;textarea name="ans"&amp;gt;&lt;br /&gt;&amp;lt;/textarea&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "ReverseThem"&lt;br /&gt;onclick = "splitButtonPressed()" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-5345691941867886226?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/5345691941867886226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=5345691941867886226' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5345691941867886226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5345691941867886226'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-string-tokenizer-for-reverse.html' title='Javascript String Tokenizer for Reverse Strings'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-6706725148794038651</id><published>2008-11-14T23:49:00.001-06:00</published><updated>2008-11-14T23:51:35.612-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript To Determine The Total Number of Occurrences of Each Letter of The Alphabet in the Text</title><content type='html'>&lt;p&gt;Write a script based on the program that inputs several lines of text and uses String method indexOf to determine the total number of occurrences of each letter of the &lt;a name="iddle2421"&gt;&lt;/a&gt;&lt;a name="iddle3350"&gt;&lt;/a&gt;&lt;a name="iddle3373"&gt;&lt;/a&gt;&lt;a name="iddle3377"&gt;&lt;/a&gt;&lt;a name="iddle3379"&gt;&lt;/a&gt;&lt;a name="iddle5955"&gt;&lt;/a&gt;&lt;a name="iddle6678"&gt;&lt;/a&gt;&lt;a name="iddle6888"&gt;&lt;/a&gt;&lt;a name="iddle7284"&gt;&lt;/a&gt;alphabet in the text. Uppercase and lowercase letters should be counted together. Store the totals for each letter in an array, and print the values in tabular format in an XHTML textarea after the totals have been determined.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;CountThem&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function search1()&lt;br /&gt;{&lt;br /&gt;var str1 = document.getElementById("string1").value;&lt;br /&gt;var str2 = new Array ("a", "b", "c" , "d", "e", "f", "g" , "h" , "i", "j", "k" , "l" , "m", "n" , "o" , "p" , "q", "r", "s", "t" , "u", "v", "w" , "x", "y" , "z");&lt;br /&gt;var str11=str1.toLowerCase();&lt;br /&gt;var len=str11.length;&lt;br /&gt;document.getElementById("ans").value="" ;&lt;br /&gt;for(i=0;i&amp;lt;26;i++)&lt;br /&gt;{&lt;br /&gt;var count=0;&lt;br /&gt;var search=str11.indexOf(str2[i]);&lt;br /&gt;for(j=0;j&amp;lt;len;j++)&lt;br /&gt;{&lt;br /&gt;if(parseInt(search)!= -1)&lt;br /&gt;{&lt;br /&gt;count++;&lt;br /&gt;var search=str11.indexOf(str2[i],parseInt(search)+1);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;if(count!=0)&lt;br /&gt;{&lt;br /&gt;document.getElementById("ans").value= document.getElementById("ans").value + "\n" + str2[i] + " Occurs " + count + " times";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;table style="width: 100%" border="0" cellpadding="0" cellspacing="0"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td valign="top"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;CountThem&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program to determine the total number of occurrences of each letter of the alphabet in the text .&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "search" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Search&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Enter any String&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "string1" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Search Result&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;textarea name="ans" rows="26" cols="20"&amp;gt;&lt;br /&gt;&amp;lt;/textarea&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "CountThem"&lt;br /&gt;onclick = "search1()" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-6706725148794038651?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/6706725148794038651/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=6706725148794038651' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6706725148794038651'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6706725148794038651'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-to-determine-total-number-of.html' title='Javascript To Determine The Total Number of Occurrences of Each Letter of The Alphabet in the Text'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-7614977364349418958</id><published>2008-11-14T23:47:00.001-06:00</published><updated>2008-11-14T23:48:45.101-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript To Determine the Number of Occurrences of the Character in the Text</title><content type='html'>&lt;p&gt;Write a script that inputs several lines of text and a search character and uses String method indexOf to determine the number of occurrences of the character in the text.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;CountIt&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function search1()&lt;br /&gt;{&lt;br /&gt;var str1 = document.getElementById("string1").value;&lt;br /&gt;var str2 = document.getElementById("string2").value;&lt;br /&gt;var len=str1.length;&lt;br /&gt;var count=0;&lt;br /&gt;var search=str1.indexOf(str2);&lt;br /&gt;for(i=0;i&amp;lt;len;i++)&lt;br /&gt;{&lt;br /&gt;if(parseInt(search)!= -1)&lt;br /&gt;{&lt;br /&gt;count++;&lt;br /&gt;var search=str1.indexOf(str2,parseInt(search)+1);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;document.getElementById("ans").value= str2 + " Occurs " + count + " times";&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;table style="width: 100%" border="0" cellpadding="0" cellspacing="0"&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;lt;td valign="top"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Exercise 11.13 CountIt&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program to determine the number of occurrences of the character in the text .&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "search" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Search&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Enter any String&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "string1" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Enter search Character&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "string2" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Search Result&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;textarea name="ans"&amp;gt;&lt;br /&gt;&amp;lt;/textarea&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "SearchIt"&lt;br /&gt;onclick = "search1()" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-7614977364349418958?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/7614977364349418958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=7614977364349418958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7614977364349418958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7614977364349418958'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-to-determine-number-of.html' title='Javascript To Determine the Number of Occurrences of the Character in the Text'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-1316121905459210</id><published>2008-11-14T23:44:00.000-06:00</published><updated>2008-11-14T23:45:46.072-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript for Compare Two Input Strings</title><content type='html'>&lt;p&gt;Write a script that uses relational and equality operators to compare two Strings input by the user through an XHTML form. Output in an XHTML textarea whether the first string is less than, equal to or greater than the second.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Compare&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function compare1()&lt;br /&gt;{&lt;br /&gt;var str1 = document.getElementById("string1").value;&lt;br /&gt;var str2 = document.getElementById("string2").value;&lt;br /&gt;if(str1 != str2)&lt;br /&gt;{&lt;br /&gt;if(str1 &amp;gt; str2)&lt;br /&gt;{&lt;br /&gt;document.getElementById("ans").value= str1 + " Greater than " + str2;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;document.getElementById("ans").value= str1 + " Less than " + str2;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;document.getElementById("ans").value= str1 + " Equals " + str2;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h1&amp;gt; Compare&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program to Compare two input strings.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "compare" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Compare&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Enter any String&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "string1" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Enter Second String&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "string2" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Output Comparison&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;textarea name="ans"&amp;gt;&lt;br /&gt;&amp;lt;/textarea&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "Compare"&lt;br /&gt;onclick = "compare1()" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-1316121905459210?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/1316121905459210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=1316121905459210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1316121905459210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1316121905459210'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-for-compare-two-input.html' title='Javascript for Compare Two Input Strings'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-4181807071779805698</id><published>2008-11-14T23:37:00.002-06:00</published><updated>2008-11-14T23:41:03.905-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript to Simulate the Rolling of Two Dice</title><content type='html'>Write a script to simulate the rolling of two dice. The script should use Math.random to roll the first die and again to roll the second die. The sum of the two values should then be calculated. [Note: Since each die can show an integer value from 1 to 6, the sum of the values will vary from 2 to 12, with 7 being the most frequent sum, and 2 and 12 the least frequent sums. Figure shows the 36 possible combinations of the two dice. Your program should roll the dice 36,000 times. Use a one-dimensional array to tally the numbers of times each possible sum appears. Display the results in an XHTML table. Also determine whether the totals are reasonable (e.g., there are six ways to roll a 7, so approximately 1/6 of all the rolls should be 7).] &lt;img id="BLOGGER_PHOTO_ID_5268754885111611330" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 353px; CURSOR: hand; HEIGHT: 206px; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_DO7Ne847YXY/SR5gpyeuf8I/AAAAAAAAAA0/dA44zHKno1k/s400/1.bmp" border="0" /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;ThrowDice&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type ="text/javascript"&amp;gt;&lt;br /&gt;var dice1;&lt;br /&gt;var dice2;&lt;br /&gt;var ans;&lt;br /&gt;var num;&lt;br /&gt;var Number;&lt;br /&gt;var i;&lt;br /&gt;function roll_dice()&lt;br /&gt;{&lt;br /&gt;var random_dice1=Math.floor(Math.random()*6);&lt;br /&gt;return random_dice1+1;&lt;br /&gt;}&lt;br /&gt;function rolling()&lt;br /&gt;{&lt;br /&gt;var combination=new Array();&lt;br /&gt;ans="";&lt;br /&gt;var display;&lt;br /&gt;display="";&lt;br /&gt;num=window.prompt("Enter how many times you want to throw the dice");&lt;br /&gt;for(i=0;i&amp;lt;12;i++)&lt;br /&gt;{&lt;br /&gt;combination[i]=0;&lt;br /&gt;}&lt;br /&gt;for(i=0;i&amp;lt;parseInt(num);i++)&lt;br /&gt;{&lt;br /&gt;dice1=roll_dice();&lt;br /&gt;dice2=roll_dice();&lt;br /&gt;ans=parseInt(dice1)+ parseInt(dice2);&lt;br /&gt;combination[ans-2]+=1;&lt;br /&gt;Number=i+1;&lt;br /&gt;display += "Roll #"+ Number + ": " + dice1 + " " + dice2 + "&amp;lt;br&amp;gt;";&lt;br /&gt;}&lt;br /&gt;div1.innerHTML=display;&lt;br /&gt;var ans1="";&lt;br /&gt;for(i=0;i&amp;lt;11;i++)&lt;br /&gt;{&lt;br /&gt;Number=i+2;&lt;br /&gt;ans1+="The Sum of "+ Number +" occurred :" + combination[i] +" Times&amp;lt;br&amp;gt;"&lt;br /&gt;}&lt;br /&gt;div2.innerHTML=ans1;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body onload="rolling()"&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt; ThrowDice1&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program for Rolling a Dice number of times as prompt by user&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "multiply" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Throw Dice Program1&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;div id="div1"&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div id="div2"&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-4181807071779805698?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/4181807071779805698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=4181807071779805698' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4181807071779805698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4181807071779805698'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-to-simulate-rolling-of-two.html' title='Javascript to Simulate the Rolling of Two Dice'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_DO7Ne847YXY/SR5gpyeuf8I/AAAAAAAAAA0/dA44zHKno1k/s72-c/1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-6085745034113266590</id><published>2008-11-14T23:32:00.001-06:00</published><updated>2008-11-14T23:35:27.866-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Sales People</title><content type='html'>&lt;p&gt;Use a one-dimensional array to solve the following problem: A company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9 percent of their gross sales for that week. For example, a salesperson who grosses $5000 in sales in a week receives $200 plus 9 percent of $5000, or a total of $650. Write a script (using an array of counters) that obtains the gross sales for each employee through an XHTML form and determines how many of the salespeople earned salaries in each of the following ranges (assume that each salesperson's salary is truncated to an integer amount):&lt;br /&gt;&lt;strong&gt;A. $200–299&lt;br /&gt;B. $300–399&lt;br /&gt;C. $400–499&lt;br /&gt;D. $500–599&lt;br /&gt;E. $600–699&lt;br /&gt;F. $700–799&lt;br /&gt;&lt;/strong&gt;&lt;a name="iddle1268"&gt;&lt;/a&gt;&lt;a name="iddle3347"&gt;&lt;/a&gt;&lt;a name="iddle4974"&gt;&lt;/a&gt;&lt;strong&gt;G. $800–899&lt;br /&gt;H. $900–999&lt;br /&gt;I.  $1000 and over&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;SalesPay&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function calculate()&lt;br /&gt;{&lt;br /&gt;var i=0; var j;&lt;br /&gt;var s = prompt("Enter Gross Sales of an Employee (Exit: -1):", "");&lt;br /&gt;var gross = parseInt(s);&lt;br /&gt;var sal_btwn = [0,0,0,0,0,0,0,0,0,0,0];&lt;br /&gt;while (gross != -1)&lt;br /&gt;{&lt;br /&gt;var income = new Array();&lt;br /&gt;var salary = 200.0 + Math.round(0.09*gross);&lt;br /&gt;income[i]=salary;&lt;br /&gt;document.writeln("The Gross sales made by salesperson in a week is $ ", +gross);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln("Salesperson's Commission is $", +income[i]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;if (income[i] &amp;gt;= 200 &amp;amp;&amp;amp; income[i] &amp;lt;= 299)&lt;br /&gt;{&lt;br /&gt;//alert(income[i]);&lt;br /&gt;//alert(sal_btwn[0]);&lt;br /&gt;sal_btwn[2] += 1;&lt;br /&gt;}&lt;br /&gt;if (income[i]&amp;gt;= 300 &amp;amp;&amp;amp; income[i]&amp;lt;= 399)&lt;br /&gt;sal_btwn[3] += 1;&lt;br /&gt;if (income[i]&amp;gt;= 400 &amp;amp;&amp;amp; income[i] &amp;lt;= 499)&lt;br /&gt;sal_btwn[4] += 1;&lt;br /&gt;if (income[i] &amp;gt;= 500 &amp;amp;&amp;amp; income[i] &amp;lt;= 599)&lt;br /&gt;sal_btwn[5] += 1;&lt;br /&gt;if (income[i] &amp;gt;= 600 &amp;amp;&amp;amp; income[i] &amp;lt;= 699)&lt;br /&gt;sal_btwn[6] += 1;&lt;br /&gt;if (income[i] &amp;gt;= 700 &amp;amp;&amp;amp; income[i] &amp;lt;= 799)&lt;br /&gt;sal_btwn[7] += 1;&lt;br /&gt;if (income[i] &amp;gt;= 800 &amp;amp;&amp;amp; income[i] &amp;lt;= 899)&lt;br /&gt;sal_btwn[8] += 1;&lt;br /&gt;if (income[i] &amp;gt;= 900 &amp;amp;&amp;amp; income[i] &amp;lt;= 999)&lt;br /&gt;sal_btwn[9] += 1;&lt;br /&gt;if (income[i] &amp;gt;= 1000)&lt;br /&gt;sal_btwn[10] += 1;&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;i++;&lt;br /&gt;var s = prompt("Enter Gross Sales of an Employee (Exit: -1):", "");&lt;br /&gt;var gross = parseInt(s);&lt;br /&gt;}&lt;br /&gt;document.writeln("&amp;lt;h4&amp;gt;Number of sales people earned salaries in each of the following ranges:&amp;lt;/h4&amp;gt;");&lt;br /&gt;document.writeln("$200-$299 : " +sal_btwn[2]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln("$300-$399 : " +sal_btwn[3]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln("$400-$499 : " +sal_btwn[4]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln("$500-$599 : " +sal_btwn[5]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln("$600-$699 : " +sal_btwn[6]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln("$700-$799 : " +sal_btwn[7]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln("$800-$899 : " +sal_btwn[8]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln("$900-$999 : " +sal_btwn[9]);&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;document.writeln(" over$1000 : " +sal_btwn[10]);&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body onload="calculate()"&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;SalesPay&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again.&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-6085745034113266590?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/6085745034113266590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=6085745034113266590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6085745034113266590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6085745034113266590'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-sales-people.html' title='Javascript Sales People'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-6539433255210709015</id><published>2008-11-14T23:30:00.001-06:00</published><updated>2008-11-14T23:31:42.098-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript to Determine Whether the Second Integer is a Multiple of the First Integer</title><content type='html'>&lt;p&gt;Write a function multiple that determines, for a pair of integers, whether the second integer is a multiple of the first. The function should take two integer arguments and return true if the second is a multiple of the first, and false otherwise. Incorporate this function into a script that inputs a series of pairs of integers (one pair at a time). The XHTML form should consist of two text fields and a button to initiate the calculation. The user should interact with the program by typing numbers in both text fields, then clicking the button.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;MultipleOf&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function multiple(f1,s1)&lt;br /&gt;{&lt;br /&gt;if(s1 % f1 == 0)&lt;br /&gt;{&lt;br /&gt;document.getElementById("ans").value=true;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;document.getElementById("ans").value=false;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;MultipleOf&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program to check whether Second Number is Multiple of First Number&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "multiply" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Multiple&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Firt Number&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "first" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Second Number&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "second" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Answer&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "ans" type = "text" disabled="disabled" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "Calculate"&lt;br /&gt;onclick = "multiple(document.multiply.first.value,document.multiply.second.value)" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-6539433255210709015?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/6539433255210709015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=6539433255210709015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6539433255210709015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6539433255210709015'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-to-determine-whether-second.html' title='Javascript to Determine Whether the Second Integer is a Multiple of the First Integer'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-1844910545410887524</id><published>2008-11-14T23:27:00.000-06:00</published><updated>2008-11-14T23:28:42.377-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript that Simulates Coin Tossing</title><content type='html'>&lt;p&gt;Write a script that simulates coin tossing. Let the program toss the coin each time the user clicks the Toss button. Count the number of times each side of the coin appears. Display the results. &lt;a name="iddle2087"&gt;&lt;/a&gt;The program should call a separate function flip that takes no arguments and returns false for tails and true for heads. [Note: If the program realistically simulates the coin tossing, each side of the coin should appear approximately half the time.]&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; TossIt &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type ="text/javascript"&amp;gt;&lt;br /&gt;var toss;&lt;br /&gt;var tails=0;&lt;br /&gt;var heads=0;&lt;br /&gt;function Toss()&lt;br /&gt;{&lt;br /&gt;toss = flip();&lt;br /&gt;if (toss == true)&lt;br /&gt;{&lt;br /&gt;heads=heads+1;&lt;br /&gt;document.getElementById("ans").value = "Heads";&lt;br /&gt;document.getElementById("heads").value=heads;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;tails=tails+1;&lt;br /&gt;document.getElementById("ans").value= "Tails";&lt;br /&gt;document.getElementById("tails").value=tails;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;function flip()&lt;br /&gt;{&lt;br /&gt;var sides;&lt;br /&gt;sides = parseInt(Math.random() * 2, 10);&lt;br /&gt;if (sides == 1)&lt;br /&gt;return true;&lt;br /&gt;else&lt;br /&gt;false;&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt; TossIt&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program toss the coin each time the user clicks the Toss button&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "multiply" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Tossing A Coin&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Coin Side&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "ans" type = "text" disabled="disabled" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Number of Heads Appear&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "heads" type = "text" disabled="disabled" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Number of Tails Appear&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "tails" type = "text" disabled="disabled" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "Toss"&lt;br /&gt;onclick = "Toss()" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-1844910545410887524?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/1844910545410887524/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=1844910545410887524' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1844910545410887524'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1844910545410887524'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-that-simulates-coin-tossing.html' title='Javascript that Simulates Coin Tossing'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-3457737840927447442</id><published>2008-11-14T23:25:00.000-06:00</published><updated>2008-11-14T23:26:24.392-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Parking Garage</title><content type='html'>&lt;p&gt;A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours at a time. Write a script that calculates and displays the parking charges for each customer who parked a car in this garage yesterday. You should input from the user the hours parked for each customer. The program should display the charge for the current customer and should calculate and display the running total of yesterday's receipts. The program should use the function calculateCharges to determine the charge for each customer. Use a text input field to obtain the input from the user.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; Park It &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var total_value=0;&lt;br /&gt;var pfee=0;&lt;br /&gt;function calculateCharges()&lt;br /&gt;{&lt;br /&gt;var customer_hours = document.getElementById("hours").value;&lt;br /&gt;var cust_hours=parseInt(customer_hours);&lt;br /&gt;var extra_hours;&lt;br /&gt;if(cust_hours &amp;lt;=3)&lt;br /&gt;{&lt;br /&gt;pfee=2;&lt;br /&gt;}&lt;br /&gt;else if(cust_hours &amp;gt; 3)&lt;br /&gt;{&lt;br /&gt;extra_hours = cust_hours - 3;&lt;br /&gt;pfee= 2 + parseInt(extra_hours)*0.5;&lt;br /&gt;if(parseInt(extra_hours) &amp;gt;= 16)&lt;br /&gt;{&lt;br /&gt;pfee=10;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;document.getElementById("charge").value=pfee;&lt;br /&gt;total();&lt;br /&gt;}&lt;br /&gt;function total()&lt;br /&gt;{&lt;br /&gt;total_value=total_value + pfee;&lt;br /&gt;document.getElementById("total").value=total_value;&lt;br /&gt;return&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Park It&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "garage" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Parking Garage Charges&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Customer Parking Hours&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "hours" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Customer Charge Amount&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "charge" type = "text" disabled="disabled" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Running Total Receipt&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "total" type = "text" disabled="disabled" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "Calculate"&lt;br /&gt;onclick = "calculateCharges()" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-3457737840927447442?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/3457737840927447442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=3457737840927447442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/3457737840927447442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/3457737840927447442'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-parking-garage.html' title='Javascript Parking Garage'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-4554590614326620105</id><published>2008-11-14T23:23:00.000-06:00</published><updated>2008-11-14T23:24:15.547-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Reversed Digits</title><content type='html'>&lt;p&gt;Write a function that takes an integer value and returns the number with its digits reversed. For example, given the number 7631, the function should return 1367. Incorporate the function into a script that reads a value from the user. Display the result of the function in the status bar.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; Reverse &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;function reverse()&lt;br /&gt;{&lt;br /&gt;var b=0;&lt;br /&gt;var num = document.getElementById("digit").value;&lt;br /&gt;var ans;&lt;br /&gt;while(parseInt(num) &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;b= b * 10;&lt;br /&gt;b= b + parseInt(num % 10)&lt;br /&gt;num =parseInt(num / 10);&lt;br /&gt;}&lt;br /&gt;window.status="Reverse Digit:" + b;&lt;br /&gt;document.getElementById("ans").value=b;&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;ReverseIt&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. This is a program to Reverse the input numbers&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "multiply" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;ReverseIt&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Input Digits&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "digit" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Reverse Digits&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "ans" type = "text" disabled="disabled" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "ReverseIt"&lt;br /&gt;onclick = "reverse()" /&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-4554590614326620105?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/4554590614326620105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=4554590614326620105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4554590614326620105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4554590614326620105'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-reversed-digits.html' title='Javascript Reversed Digits'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-2213807051833466685</id><published>2008-11-14T23:20:00.001-06:00</published><updated>2008-11-14T23:21:59.074-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Guess the Number</title><content type='html'>&lt;p&gt;Write a script that plays a "guess the number" game as follows: Your program chooses the number to be guessed by selecting a random integer in the range 1 to 1000. The script displays the prompt Guess a number between 1 and 1000 next to a text field. The player types a first guess into the text field and clicks a button to submit the guess to the script. If the player's guess is incorrect, your program should display Too high. Try again. or Too low. Try again. to help the player "zero in" on the correct answer and should clear the text field so the user can enter the next guess. When the user enters the correct answer, display Congratulations. You guessed the number! and clear the text field so the user can play again.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;GuessIt by Wasim&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var num = Math.random()*(999)+1;&lt;br /&gt;function Guess()&lt;br /&gt;{&lt;br /&gt;var guess = parseInt(document.getElementById("hint").value);&lt;br /&gt;if (guess &amp;lt; num)&lt;br /&gt;document.getElementById("guesshint").value= "No, guess higher.";&lt;br /&gt;if (guess &amp;gt; num)&lt;br /&gt;document.getElementById("guesshint").value= "No, guess lower.";&lt;br /&gt;if (guess == num)&lt;br /&gt;{&lt;br /&gt;window.alert("Congratulations! You guessed the number");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt; Guess It&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again. Guess Number&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;form name = "guessform" action = ""&amp;gt;&lt;br /&gt;&amp;lt;table border = "1"&amp;gt;&lt;br /&gt;&amp;lt;caption&amp;gt;Guess Random Number&amp;lt;/caption&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Input Any Number between 1 and 1000&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "hint" type = "text" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Hint&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;td&amp;gt;&amp;lt;input name = "guesshint" type = "text" disabled="disabled" /&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;input type = "button" value = "Calculate" onclick= "Guess()"/&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-2213807051833466685?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/2213807051833466685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=2213807051833466685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/2213807051833466685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/2213807051833466685'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-guess-number.html' title='Javascript Guess the Number'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-4348041993425695225</id><published>2008-11-14T23:17:00.000-06:00</published><updated>2008-11-14T23:18:18.459-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Smallest of Several Non-Negative Integers</title><content type='html'>Write a script that finds the smallest of several non-negative integers. Assume that the first value read specifies the number of values to be input from the user.&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; Smallest Integer &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Smallest Integer&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var itemcount;&lt;br /&gt;var i;&lt;br /&gt;var small=0;&lt;br /&gt;var cal;&lt;br /&gt;itemcount = window.prompt("How many inputs you wish to enter:");&lt;br /&gt;var count = parseInt(itemcount);&lt;br /&gt;var myarray= new Array(count);&lt;br /&gt;for(i=0;i&amp;lt;count;i++)&lt;br /&gt;{&lt;br /&gt;myarray[i]= window.prompt("Enter any number:");&lt;br /&gt;}&lt;br /&gt;cal=myarray[0];&lt;br /&gt;for(i=0;i&amp;lt;count;i++)&lt;br /&gt;{&lt;br /&gt;if(parseInt(myarray[i])&amp;lt; cal)&lt;br /&gt;cal= myarray[i];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Smallest of all input numbers is: " + cal + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-4348041993425695225?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/4348041993425695225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=4348041993425695225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4348041993425695225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4348041993425695225'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-smallest-of-several-non.html' title='Javascript Smallest of Several Non-Negative Integers'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-6463291201641510845</id><published>2008-11-14T23:14:00.000-06:00</published><updated>2008-11-14T23:16:03.660-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Star Pattern</title><content type='html'>&lt;p&gt;Write a script that outputs XHTML to display the given patterns separately, one below the other. Use for statements to generate the patterns. All asterisks (*) should be printed by a single statement of the form document.write( "*" ); (this causes the asterisks to print side by side). A statement of the form document.writeln( "&lt;br /&gt;" ); can be used to position to the next line. A statement of the form document.write( " " ); can be used to display a space (needed for the last two patterns). There should be no other output statements in the program. [Hint: The last two patterns require that each line begin with an appropriate number of blanks. You may need to use the XHTML &lt;pre&gt;&lt;/pre&gt; tags.]&lt;br /&gt;1.&lt;/p&gt;&lt;p&gt;*&lt;br /&gt;**&lt;br /&gt;***&lt;br /&gt;****&lt;br /&gt;*****&lt;br /&gt;******&lt;br /&gt;*******&lt;br /&gt;********&lt;br /&gt;*********&lt;br /&gt;**********&lt;/p&gt;&lt;p&gt;2.&lt;br /&gt;**********&lt;br /&gt;*********&lt;br /&gt;********&lt;br /&gt;*******&lt;br /&gt;******&lt;br /&gt;*****&lt;br /&gt;****&lt;br /&gt;***&lt;br /&gt;**&lt;br /&gt;*&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; Seeing Stars &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type = "text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;nextRow1: // target label of continue statement&lt;br /&gt;for ( var row = 1; row &amp;lt;= 10; ++row )&lt;br /&gt;{&lt;br /&gt;document.writeln( "&amp;lt;br /&amp;gt;" );&lt;br /&gt;for ( var column = 1; column &amp;lt;= 10; ++column )&lt;br /&gt;{&lt;br /&gt;if ( column &amp;gt; row )&lt;br /&gt;continue nextRow1; // next iteration of&lt;br /&gt;// labeled loop&lt;br /&gt;document.write( "* " );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;document.writeln( "&amp;lt;br /&amp;gt;" );&lt;br /&gt;nextRow:&lt;br /&gt;for ( var row = 1; row &amp;lt;= 10; ++row )&lt;br /&gt;{&lt;br /&gt;document.writeln( "&amp;lt;br /&amp;gt;" );&lt;br /&gt;for ( var column = 10; column &amp;gt;= 1; column-- )&lt;br /&gt;{&lt;br /&gt;if ( column &amp;lt; row )&lt;br /&gt;continue nextRow; // next iteration of&lt;br /&gt;// labeled loop&lt;br /&gt;document.write( "* " );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;nextRow2:&lt;br /&gt;for ( var row = 1; row &amp;lt;= 10; ++row )&lt;br /&gt;{&lt;br /&gt;document.writeln( "&amp;lt;br /&amp;gt;" );&lt;br /&gt;for(var space=0; space&amp;lt;10; space++)&lt;br /&gt;{&lt;br /&gt;document.write("&amp;amp;nbsp;");&lt;br /&gt;}&lt;br /&gt;for ( var column = 10; column &amp;gt;= 1; column-- )&lt;br /&gt;{&lt;br /&gt;if ( column &amp;lt; row )&lt;br /&gt;continue nextRow2; // next iteration of&lt;br /&gt;// labeled loop&lt;br /&gt;document.write( "*" );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;&amp;lt;center&amp;gt;Seeing Stars &amp;lt;/center&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt; Click Refresh(F5) or reload to run this script again&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-6463291201641510845?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/6463291201641510845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=6463291201641510845' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6463291201641510845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6463291201641510845'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-star-pattern.html' title='Javascript Star Pattern'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-8742369371521372154</id><published>2008-11-14T23:07:00.001-06:00</published><updated>2008-11-14T23:07:45.961-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Multiply It</title><content type='html'>&lt;p&gt;Write a script that calculates the product of the odd integers from 1 to 15 then outputs XHTML text that displays the results.&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; Multiply It &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt; Multiply It &amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var number;&lt;br /&gt;var i;&lt;br /&gt;var ans=1;&lt;br /&gt;number = window.prompt("Enter any odd number between 1 and 35:");&lt;br /&gt;var count = parseInt(number);&lt;br /&gt;if(count % 2 == 0)&lt;br /&gt;{&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Your input number " + number + " is not an odd number&amp;lt;/h1&amp;gt;" );&lt;br /&gt;}&lt;br /&gt;else if(count &amp;gt;= 1 &amp;amp;&amp;amp; count &amp;lt;= 35)&lt;br /&gt;{&lt;br /&gt;for(i=1;i&amp;lt;=count;i=i+1)&lt;br /&gt;{&lt;br /&gt;ans=ans*i;&lt;br /&gt;}&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; The product of 1 to " + number + " is: " + ans + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Input Odd number " + number + " doesn't seems to be in range between 1 and 35 &amp;lt;/h1&amp;gt;" );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-8742369371521372154?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/8742369371521372154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=8742369371521372154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/8742369371521372154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/8742369371521372154'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-multiply-it.html' title='Javascript Multiply It'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-5079367340140500782</id><published>2008-11-14T23:03:00.000-06:00</published><updated>2008-11-14T23:05:29.714-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Mail Order</title><content type='html'>A mail-order house sells five different products whose retail prices are as follows: product 1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49; and product 5, $6.87. Write a script that reads a series of pairs of numbers as follows:&lt;br /&gt;&lt;br /&gt;1. Product number&lt;br /&gt;2. Quantity sold for one day&lt;br /&gt;&lt;br /&gt;Your program should use a switch statement to determine each product's retail price and should calculate and output XHTML that displays the total retail value of all the products sold last week. Use a prompt dialog to obtain the product number and quantity from the user. Use a sentinel-controlled loop to determine when the program should stop looping and display the final results.&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; Mail Order &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var q;&lt;br /&gt;var p;&lt;br /&gt;var qty;&lt;br /&gt;var price;&lt;br /&gt;var pno=0;&lt;br /&gt;var ans=0;&lt;br /&gt;var counter=0;&lt;br /&gt;total=0;&lt;br /&gt;document.write("Enter product number for an item, -1 to quit: &amp;lt;br /&amp;gt; 1. Product-1 &amp;lt;br /&amp;gt; 2. Product-2 &amp;lt;br /&amp;gt; 3. product-3 &amp;lt;br /&amp;gt; 4. Product-4 &amp;lt;br /&amp;gt; 5. Product-5");&lt;br /&gt;pno=window.prompt("Enter product number, -1 to Quit");&lt;br /&gt;p=parseInt(pno);&lt;br /&gt;while(pno!=-1)&lt;br /&gt;{&lt;br /&gt;switch(p)&lt;br /&gt;{&lt;br /&gt;case 1: price= 2.98;&lt;br /&gt;q= window.prompt("Enter number of quantities sold for product-1:");&lt;br /&gt;qty=parseInt(q);&lt;br /&gt;ans=price*qty;&lt;br /&gt;break;&lt;br /&gt;case 2: price= 4.50;&lt;br /&gt;q= window.prompt("Enter number of quantities sold for product-2:");&lt;br /&gt;qty=parseInt(q);&lt;br /&gt;ans=price*qty;&lt;br /&gt;break;&lt;br /&gt;case 3: price= 9.98;&lt;br /&gt;q= window.prompt("Enter number of quantities sold for product-3:");&lt;br /&gt;qty=parseInt(q);&lt;br /&gt;ans=price*qty;&lt;br /&gt;break;&lt;br /&gt;case 4: price= 4.49;&lt;br /&gt;q= window.prompt("Enter number of quantities sold for product-4:");&lt;br /&gt;qty=parseInt(q);&lt;br /&gt;ans=price*qty;&lt;br /&gt;break;&lt;br /&gt;case 5: price= 6.87;&lt;br /&gt;q= window.prompt("Enter number of quantities sold for product-5:");&lt;br /&gt;qty=parseInt(q);&lt;br /&gt;ans=price*qty;&lt;br /&gt;break;&lt;br /&gt;default: window.alert("No proper input, Please try Again");&lt;br /&gt;break;&lt;br /&gt;}&lt;br /&gt;counter=counter+1;&lt;br /&gt;total=total + parseInt(ans);&lt;br /&gt;pno=window.prompt("Enter product number, -1 to Quit");&lt;br /&gt;p=parseInt(pno);&lt;br /&gt;}&lt;br /&gt;if(counter!=0)&lt;br /&gt;{&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Total Sales for Last week is: $" + total + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;window.alert("No product number is entered, Thank you");&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Mail Order&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again.&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-5079367340140500782?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/5079367340140500782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=5079367340140500782' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5079367340140500782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5079367340140500782'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-mail-order.html' title='Javascript Mail Order'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-7606063551112836526</id><published>2008-11-14T23:00:00.001-06:00</published><updated>2008-11-14T23:00:56.216-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Pay Day</title><content type='html'>&lt;p&gt;Develop a JavaScript program that will determine the gross pay for each of three employees. The company pays "straight time" for the first 40 hours worked by each employee and pays "time and a half" for all hours worked in excess of 40 hours. You are given a list of the employees of the company, the number of hours each employee worked last week and the hourly rate of each employee. Your program should input this information for each employee, determine the employee's gross pay and output XHTML text that displays the employee's gross pay. Use prompt dialogs to input the data.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Pay Day &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var e1;&lt;br /&gt;var r1;&lt;br /&gt;var e2;&lt;br /&gt;var r2;&lt;br /&gt;var e3;&lt;br /&gt;var r3;&lt;br /&gt;e1 = window.prompt("Enter Number of Hours Employee1 worked last week:");&lt;br /&gt;r1 = window.prompt("Enter hourly wage rate for Employee1:");&lt;br /&gt;e2 = window.prompt("Enter Number of Hours Employee2 worked last week:");&lt;br /&gt;r2 = window.prompt("Enter hourly wage rate for Employee2:");&lt;br /&gt;e3 = window.prompt("Enter Number of Hours Employee3 worked last week:");&lt;br /&gt;r3 = window.prompt("Enter hourly wage rate for Employee3:");&lt;br /&gt;var cal1;&lt;br /&gt;if(parseInt(e1)&amp;gt;40)&lt;br /&gt;{&lt;br /&gt;var extrahours = parseInt(parseInt(e1)-40);&lt;br /&gt;var extrarate= parseInt(r1) + (parseInt(r1) / 2 );&lt;br /&gt;cal1= ((40 * parseInt(r1))+ (extrahours * parseInt(extrarate)));&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;cal1=parseInt(e1) * parseInt(r1);&lt;br /&gt;}&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Employee1 Gross Wage is: " + cal1 + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;var cal2;&lt;br /&gt;if(parseInt(e2)&amp;gt;40)&lt;br /&gt;{&lt;br /&gt;var extrahours1 = parseInt(parseInt(e2)-40);&lt;br /&gt;var extrarate1= parseInt(r2) + (parseInt(r2) / 2 );&lt;br /&gt;cal2= ((40 * parseInt(r2))+ (extrahours1 * parseInt(extrarate1)));&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;cal2=parseInt(e2) * parseInt(r2);&lt;br /&gt;}&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Employee2 Gross Wage is: " + cal2 + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;var cal3;&lt;br /&gt;if(parseInt(e3)&amp;gt;40)&lt;br /&gt;{&lt;br /&gt;var extrahours2 = parseInt(parseInt(e3)-40);&lt;br /&gt;var extrarate2= parseInt(r3) + (parseInt(r3) / 2 );&lt;br /&gt;cal3= ((40 * parseInt(r3))+ (extrahours2 * parseInt(extrarate2)));&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;cal3=parseInt(e3) * parseInt(r3);&lt;br /&gt;}&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Employee3 Gross Wage is: " + cal3+ "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;&amp;lt;center&amp;gt;Pay Day&amp;lt;/center&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt; Click Refresh(F5) or reload to run this script again&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-7606063551112836526?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/7606063551112836526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=7606063551112836526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7606063551112836526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7606063551112836526'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-pay-day.html' title='Javascript Pay Day'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-2799131999490348095</id><published>2008-11-14T22:57:00.000-06:00</published><updated>2008-11-14T22:58:57.059-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Palindrome</title><content type='html'>A palindrome is a number or a text phrase that reads the same backward and forward. For example, each of the following five-digit integers is a palindrome: 12321, 55555, 45554 and 11611. Write a script that reads in a five-digit integer and determines whether it is a palindrome. If the number is not five digits long, display an alert dialog indicating the problem to the user. Allow the user to enter a new value after dismissing the alert dialog. [Hint: It is possible to do this exercise with the techniques learned in this chapter. You will need to use both division and remainder operations to "pick off" each digit.]&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt; Palindrome &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var number;&lt;br /&gt;number = window.prompt("Enter any 5 Digit number:");&lt;br /&gt;var n = parseInt(number);&lt;br /&gt;while(n&amp;lt;10000  n &amp;gt; 99999 )&lt;br /&gt;{&lt;br /&gt;window.alert("The Number is not a five digit number");&lt;br /&gt;number = window.prompt("Enter any 5 Digit number:");&lt;br /&gt;n = parseInt(number);&lt;br /&gt;}&lt;br /&gt;var digit1 = n%10;&lt;br /&gt;n = n/10;&lt;br /&gt;var digit2 = n%10;&lt;br /&gt;n = n/10;&lt;br /&gt;var digit3 = n%10;&lt;br /&gt;n = n/10;&lt;br /&gt;var digit4 = n%10;&lt;br /&gt;var digit5 = n/10;&lt;br /&gt;if(parseInt(digit1)==parseInt(digit5))&lt;br /&gt;{&lt;br /&gt;if(parseInt(digit2)==parseInt(digit4))&lt;br /&gt;{&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt;" + number + " is a Palindrome &amp;lt;/h1&amp;gt;" );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt;" + number + " is not a Palindrome &amp;lt;/h1&amp;gt;" );&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt; Palindrome &amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt; Click Refresh(F5) or reload to run this script again&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-2799131999490348095?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/2799131999490348095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=2799131999490348095' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/2799131999490348095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/2799131999490348095'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-palindrome.html' title='Javascript Palindrome'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-895169333782731205</id><published>2008-11-14T22:55:00.000-06:00</published><updated>2008-11-14T22:56:02.603-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Mileage Calculation</title><content type='html'>Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several tankfuls of gasoline by recording the number of miles driven and the number of gallons used for each tankful. Develop a JavaScript program that will take as input the miles driven and gallons used (both as integers) for each tankful. The program should calculate and output XHTML text that displays the number of miles per gallon obtained for each tankful and prints the combined number of miles per gallon obtained for all tankfuls up to this point. Use prompt dialogs to obtain the data from the user.&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Mileage&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var g1;&lt;br /&gt;var m1;&lt;br /&gt;var a1;&lt;br /&gt;var a2;&lt;br /&gt;var a3;&lt;br /&gt;var g2;&lt;br /&gt;var m2;&lt;br /&gt;var g3;&lt;br /&gt;var m3;&lt;br /&gt;var avgall;&lt;br /&gt;g1 = window.prompt("Enter Number of Gallons used for Tank1:");&lt;br /&gt;m1 = window.prompt("Enter number of miles drived for Tank1:");&lt;br /&gt;g2 = window.prompt("Enter Number of Gallons used for Tank2:");&lt;br /&gt;m2 = window.prompt("Enter number of miles drived for Tank2:");&lt;br /&gt;g3 = window.prompt("Enter Number of Gallons used for Tank3:");&lt;br /&gt;m3 = window.prompt("Enter number of miles drived for Tank3:");&lt;br /&gt;a1 = parseInt(m1) / parseInt(g1);&lt;br /&gt;a2 = parseInt(m2) / parseInt(g2);&lt;br /&gt;a3 = parseInt(m3) / parseInt(g3);&lt;br /&gt;avgall = ((parseInt(m1) + parseInt(m2) + parseInt(m3)) / (parseInt(g1) + parseInt(g2) + parseInt(g3)));&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Miles per Gallon for Tank1 is: " + a1 + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Miles per Gallon for Tank2 is: " + a2 + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Miles per Gallon for Tank3 is: " + a3 + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Combined Miles per Gallon for all Tank is: " + avgall + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;&amp;lt;center&amp;gt;Mileage Calculation&amp;lt;/center&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt; Click Refresh(F5) or reload to run this script again&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-895169333782731205?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/895169333782731205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=895169333782731205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/895169333782731205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/895169333782731205'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-mileage-calculation.html' title='Javascript Mileage Calculation'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-6745447818671179339</id><published>2008-11-14T22:51:00.001-06:00</published><updated>2008-11-14T22:53:35.440-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Commission</title><content type='html'>&lt;p&gt;A large company pays its salespeople on a commission basis. The salespeople receive $200 per week, plus 9 percent of their gross sales for that week. For example, a salesperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of the items sold by each salesperson. The values of these items are as follows:&lt;br /&gt;&lt;strong&gt;Item   Value&lt;br /&gt;&lt;/strong&gt;1          239.99&lt;br /&gt;2         129.75&lt;br /&gt;3         99.95&lt;br /&gt;4         350.89&lt;br /&gt;Develop a program that inputs one salesperson's items sold for last week, calculates the salesperson's earnings and outputs XHTML text that displays the salesperson's earnings.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Commission&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var itemcount;&lt;br /&gt;var i;&lt;br /&gt;var sum=0;&lt;br /&gt;var cal;&lt;br /&gt;itemcount = window.prompt("How many item/items Salesman sale last week:");&lt;br /&gt;var count = parseInt(itemcount);&lt;br /&gt;for(i=0;i&amp;lt;count;i++)&lt;br /&gt;{&lt;br /&gt;cal = window.prompt("Enter item number:");&lt;br /&gt;var getprice = parseInt(cal);&lt;br /&gt;if(getprice == 1)&lt;br /&gt;{&lt;br /&gt;sum = sum + 239.99;&lt;br /&gt;}&lt;br /&gt;else if(getprice == 2)&lt;br /&gt;{&lt;br /&gt;sum = sum + 129.75;&lt;br /&gt;}&lt;br /&gt;else if(getprice == 3)&lt;br /&gt;{&lt;br /&gt;sum = sum + 99.95;&lt;br /&gt;}&lt;br /&gt;else if(getprice == 4)&lt;br /&gt;{&lt;br /&gt;sum = sum + 350.89;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;window.alert("There is no such Item Number exists, Please try again");&lt;br /&gt;exit();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;var sal= 200 + (( 9 / 100)* parseInt(sum));&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; Total Salary for this salesperson is: " + sal + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Commission&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Press F5 or Refresh to load script again.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-6745447818671179339?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/6745447818671179339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=6745447818671179339' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6745447818671179339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6745447818671179339'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-commission.html' title='Javascript Commission'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-7802562181017998013</id><published>2008-11-14T22:41:00.003-06:00</published><updated>2008-11-14T22:49:34.463-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Checkerboard Program</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_DO7Ne847YXY/SR5U1ZxHsgI/AAAAAAAAAAs/7SbRx8v-ApE/s1600-h/checkerboard.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5268741890496770562" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 138px; CURSOR: hand; HEIGHT: 135px" alt="" src="http://1.bp.blogspot.com/_DO7Ne847YXY/SR5U1ZxHsgI/AAAAAAAAAAs/7SbRx8v-ApE/s400/checkerboard.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Write a script that outputs XHTML text that displays in the XHTML document a checkerboard pattern, as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Checkerboard&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var i = 1;&lt;br /&gt;var j = 1;&lt;br /&gt;for ( i = 1; i&amp;lt;=8; i ++)&lt;br /&gt;{&lt;br /&gt;for ( j = 1; j&amp;lt;=8; j++)&lt;br /&gt;{&lt;br /&gt;document.write("* ");&lt;br /&gt;}&lt;br /&gt;document.write("&amp;lt;br /&amp;gt;");&lt;br /&gt;if(i%2)&lt;br /&gt;{&lt;br /&gt;document.write("&amp;amp;nbsp;");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt; Checkerboard Program &amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;hr /&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt; Click Refresh(F5) or reload to run this script again &amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-7802562181017998013?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/7802562181017998013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=7802562181017998013' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7802562181017998013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7802562181017998013'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-checkerboard-program.html' title='Javascript Checkerboard Program'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_DO7Ne847YXY/SR5U1ZxHsgI/AAAAAAAAAAs/7SbRx8v-ApE/s72-c/checkerboard.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-1889689245782399402</id><published>2008-11-13T02:48:00.000-06:00</published><updated>2008-11-13T02:50:23.396-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Sum, Average, Product, Largest for Three Numbers</title><content type='html'>Write a script that takes three integers from the user and displays the sum, average, product, smallest and largest of the numbers in an alert dialog.&lt;br /&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Exercise 6.18 Three Digit Math &amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var firstnum;&lt;br /&gt;var secondnum;&lt;br /&gt;var flag = 0;&lt;br /&gt;firstnum = window.prompt("Enter any Integer Value:");&lt;br /&gt;secondnum = window.prompt("Enter any second Integer Value:");&lt;br /&gt;thirdnum = window.prompt("Enter any third Integer Value:");&lt;br /&gt;var first = parseInt(firstnum);&lt;br /&gt;var second = parseInt(secondnum);&lt;br /&gt;var third = parseInt(thirdnum);&lt;br /&gt;var sum = first + second + third;&lt;br /&gt;var avg = (first + second + third) / 3;&lt;br /&gt;var prod= first * second * third;&lt;br /&gt;if(first&amp;gt;=second &amp;amp;&amp;amp; first&amp;gt;=third)&lt;br /&gt;{&lt;br /&gt;if(second&amp;gt;third)&lt;br /&gt;{&lt;br /&gt;window.alert( " SUM: " + sum + "\n Average: " + avg + "\n Product: " + prod + "\n" + third + " is the smallest number" + "\n" + first + " is the largest of all three numbers" );&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;window.alert( " SUM: " + sum + "\n Average: " + avg + "\n Product: " + prod + "\n" + second + " is the smallest number" + "\n" + first + " is the largest of all three numbers" );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else if(second&amp;gt;=first &amp;amp;&amp;amp; second&amp;gt;=third)&lt;br /&gt;{&lt;br /&gt;if(first&amp;gt;third)&lt;br /&gt;{&lt;br /&gt;window.alert( " SUM: " + sum + "\n Average: " + avg + "\n Product: " + prod + "\n" + third + " is the smallest number" + "\n" + second + " is the largest of all three numbers" );&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;window.alert( " SUM: " + sum + "\n Average: " + avg + "\n Product: " + prod + "\n" + first + " is the smallest number" + "\n" + second + " is the largest of all three numbers" );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else if(third&amp;gt;=first &amp;amp;&amp;amp; third&amp;gt;=second)&lt;br /&gt;{&lt;br /&gt;if(first&amp;gt;second)&lt;br /&gt;{&lt;br /&gt;window.alert( " SUM: " + sum + "\n Average: " + avg + "\n Product: " + prod + "\n" + second + " is the smallest number" + "\n" + third + " is the largest of all three numbers" );&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;window.alert( " SUM: " + sum + "\n Average: " + avg + "\n Product: " + prod + "\n" + first + " is the smallest number" + "\n" + third + " is the largest of all three numbers" );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-1889689245782399402?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/1889689245782399402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=1889689245782399402' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1889689245782399402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1889689245782399402'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-sum-average-product-largest.html' title='Javascript Sum, Average, Product, Largest for Three Numbers'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-5150989553081321087</id><published>2008-11-13T02:45:00.000-06:00</published><updated>2008-11-13T02:46:30.502-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Compare Two Integers</title><content type='html'>&lt;p&gt;Write a script that asks the user to enter two integers, obtains the numbers from the user and outputs text that displays the larger number followed by the words "is larger" in an alert dialog. If the numbers are equal, output XHTML text that displays the message "These numbers are equal."&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Exercise 6.17 Compare Them&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var firstnum;&lt;br /&gt;var secondnum;&lt;br /&gt;firstnum = window.prompt("Enter any Integer Value:");&lt;br /&gt;secondnum = window.prompt("Enter any second Integer Value:");&lt;br /&gt;var first = parseInt(firstnum);&lt;br /&gt;var second = parseInt(secondnum);&lt;br /&gt;if(first&amp;gt;second)&lt;br /&gt;{&lt;br /&gt;window.alert( first + " is Larger than " + second );&lt;br /&gt;}&lt;br /&gt;else if(second&amp;gt;first)&lt;br /&gt;{&lt;br /&gt;window.alert( second + " is Larger than " + first );&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;window.alert( first + " is equal to " + second );&lt;br /&gt;}&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-5150989553081321087?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/5150989553081321087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=5150989553081321087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5150989553081321087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5150989553081321087'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-compare-two-integers.html' title='Javascript Compare Two Integers'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-1132878345915432194</id><published>2008-11-13T02:33:00.003-06:00</published><updated>2008-11-13T02:41:10.371-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Javascript'/><title type='text'>Javascript Radius of a Circle</title><content type='html'>&lt;p&gt;Write a script that gets from the user the radius of a circle and outputs XHTML text that displays the circle's diameter, circumference and area. Use the constant value 3.14159 for π. Use the GUI techniques shown in Fig. 6.9. [Note: You may also use the predefined constant Math.PI for the value of π. This constant is more precise than the value 3.14159. The Math object is defined by JavaScript and provides many common mathematical capabilities.] Use the following formulas (r is the radius): diameter = 2r, circumference = 2πr, area = πr 2.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;?xml version = "1.0" encoding = "utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"&lt;br /&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Exercise 6.19 Circle It&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var radius;&lt;br /&gt;radius = window.prompt("Enter Radius of a circle:");&lt;br /&gt;var r = parseInt(radius);&lt;br /&gt;var d = 2 * r;&lt;br /&gt;var circum= 2 * 3.14159 * r;&lt;br /&gt;var area = Math.PI * r * r;&lt;br /&gt;document.writeln( "&amp;lt;h1&amp;gt; The Diameter of a cirlce is: " + d + "&amp;lt;/h1&amp;gt;" );&lt;br /&gt;document.writeln("&amp;lt;h1&amp;gt; The Circumference: " + circum + "&amp;lt;/h1&amp;gt;");&lt;br /&gt;document.writeln("&amp;lt;h1&amp;gt; The Area of a cirlce is: " + area + "&amp;lt;/h1&amp;gt;");&lt;br /&gt;// --&amp;gt;&lt;br /&gt;&amp;lt;/script&amp;gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt; Click Refresh(F5) or reload to run this script again&amp;lt;/p&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-1132878345915432194?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/1132878345915432194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=1132878345915432194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1132878345915432194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1132878345915432194'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/javascript-radius-of-circle_13.html' title='Javascript Radius of a Circle'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-4997602212561643408</id><published>2008-11-10T00:41:00.004-06:00</published><updated>2008-11-10T00:53:06.221-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='T-Mobile Samsung Behold'/><title type='text'>T-Mobile releases Samsung Behold</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_DO7Ne847YXY/SRfZDJFAYuI/AAAAAAAAAAc/DESOTn-HtEE/s1600-h/espresso_001.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5266916937232835298" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; WIDTH: 181px; CURSOR: hand; HEIGHT: 400px" alt="" src="http://2.bp.blogspot.com/_DO7Ne847YXY/SRfZDJFAYuI/AAAAAAAAAAc/DESOTn-HtEE/s400/espresso_001.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;Today, T-Mobile officially released the rumored &lt;/span&gt;&lt;span style="color:#000000;"&gt;Samsung&lt;/span&gt;&lt;span style="color:#000000;"&gt; Behold and Samsung Gravity. The Behold has a large touchscreen display while the Gravity has a sliding QWERTY &lt;/span&gt;&lt;span style="color:#000000;"&gt;keyboard&lt;/span&gt;&lt;span style="color:#000000;"&gt;.&lt;br /&gt;Touchscreen &lt;/span&gt;&lt;span style="color:#000000;"&gt;Samsung T919 Behold&lt;/span&gt;&lt;span style="color:#000000;"&gt; looks like the Samsung &lt;/span&gt;&lt;span style="color:#000000;"&gt;F480&lt;/span&gt;&lt;span style="color:#000000;"&gt; but on steroids. On top of the touchscreen TouchWiz interface, 5 megapixel autofocus &lt;/span&gt;&lt;span style="color:#000000;"&gt;camera&lt;/span&gt;&lt;span style="color:#000000;"&gt;, 3G support, full HTML browser the new Behold scores higher with its built-in &lt;/span&gt;&lt;span style="color:#000000;"&gt;GPS&lt;/span&gt;&lt;span style="color:#000000;"&gt;. Unfortunately, even the Behold does not feature the highly desirable Wi-Fi feature.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;Samsung Behold can be yours starting from November 10 for $149.99 on a 2 year contract in light rose color.&lt;/span&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;Feature&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Real web browsing*&lt;/strong&gt;&lt;br /&gt;Get more pages and better Web content delivered efficiently to your phone.&lt;br /&gt;&lt;strong&gt;3G&lt;br /&gt;&lt;/strong&gt;T-Mobile’s high-speed 3G data network delivers the ultimate mobile Web experience in several metropolitan areas&lt;br /&gt;&lt;strong&gt;5 Megapixel Camera&lt;br /&gt;&lt;/strong&gt;With quality worth printing, now you can really enjoy those special moments captured on your phone. You can also share them with family and friends by sending them to any e-mail address, T-Mobile camera phone, or MyAlbum.&lt;br /&gt;&lt;strong&gt;Music player&lt;/strong&gt;&lt;br /&gt;Play your favorite music wherever you are.&lt;br /&gt;&lt;strong&gt;Video capture/playback&lt;/strong&gt;&lt;br /&gt;Capture and play back short video clips.&lt;br /&gt;&lt;strong&gt;Stereo Bluetooth® wireless technology&lt;/strong&gt;&lt;br /&gt;Connect your phone to your computer or stereo headset without any wires.&lt;br /&gt;&lt;strong&gt;Picture messaging*&lt;/strong&gt;&lt;br /&gt;Send pictures from your phone to others.&lt;br /&gt;&lt;strong&gt;Text messaging*&lt;/strong&gt;&lt;br /&gt;The quick, quiet way to stay connected.&lt;br /&gt;&lt;strong&gt;Voice dialing&lt;br /&gt;&lt;/strong&gt;Call someone with simple voice commands to keep your hands free for activities like driving.&lt;br /&gt;&lt;strong&gt;myFaves capable*&lt;/strong&gt;&lt;br /&gt;Get unlimited any-network calling to any 5 people with a myFaves plan.&lt;br /&gt;&lt;strong&gt;Address book&lt;/strong&gt;&lt;br /&gt;The info you need to contact your contacts.&lt;br /&gt;&lt;strong&gt;Calculator&lt;/strong&gt;&lt;br /&gt;A handy way to check your figures.&lt;br /&gt;&lt;strong&gt;Calendar&lt;/strong&gt;&lt;br /&gt;Keep track of appointments and even set reminders to make sure you're on time.&lt;br /&gt;&lt;strong&gt;Alarm clock&lt;/strong&gt;&lt;br /&gt;Handy reminders help you stay on schedule.&lt;br /&gt;&lt;strong&gt;Micro SD memory standard&lt;br /&gt;&lt;/strong&gt;Easily take the memory card out of your device to transfer files and data to another device.&lt;br /&gt;&lt;strong&gt;HiFi Ringers™, MegaTones®, Wallpapers*&lt;/strong&gt;&lt;br /&gt;Download sounds and voices from your favorite artists, instrumental versions of songs, and wallpapers.&lt;br /&gt;&lt;strong&gt;Speaker phone&lt;br /&gt;&lt;/strong&gt;Put down the phone and keep talking with a convenient speakerphone.&lt;br /&gt;&lt;strong&gt;Vibrating alert&lt;/strong&gt;&lt;br /&gt;Phone vibrates to let you know you have a call or message without disturbing anyone.&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-4997602212561643408?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/4997602212561643408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=4997602212561643408' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4997602212561643408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4997602212561643408'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/t-mobile-releases-samsung-behold.html' title='T-Mobile releases Samsung Behold'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_DO7Ne847YXY/SRfZDJFAYuI/AAAAAAAAAAc/DESOTn-HtEE/s72-c/espresso_001.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-7850745231402312803</id><published>2008-11-09T21:13:00.004-06:00</published><updated>2008-11-09T21:18:06.828-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computer Privacy'/><title type='text'>Privacy in Technology</title><content type='html'>&lt;p&gt;&lt;strong&gt;What is Privacy?&lt;/strong&gt;&lt;br /&gt;Privacy is the claim of individuals, groups or institutions to determine for themselves when, how, and to what extent information about them is communicated to others.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Ways to Protect Privacy&lt;/strong&gt;&lt;br /&gt;• There are two basic ways to protect privacy:&lt;br /&gt;1. Technology&lt;br /&gt;2. Law&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Privacy for end users&lt;br /&gt;&lt;/strong&gt;1. Who’s watching you?&lt;br /&gt;2. Why?&lt;br /&gt;3. What can I do?&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Current Privacy Options&lt;br /&gt;&lt;/strong&gt;1. Share Nothing&lt;br /&gt;2. Share Everything&lt;br /&gt;3. Manage a crowd &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Types of Privacy Harms&lt;/strong&gt;&lt;br /&gt;1. Intrusions&lt;br /&gt;2. Information collection&lt;br /&gt;3. Information processing&lt;/p&gt;&lt;p&gt;The attacks of Sept. 11 left us with a terrible Vulnerability on human, world's computers, networks, and information systems. &lt;/p&gt;&lt;p&gt;&lt;strong&gt;What is Internet Privacy?&lt;/strong&gt;&lt;br /&gt;The ability to control what information one reveals about oneself over the Internet, and to control who can access that information.&lt;br /&gt;Protecting Your Online Privacy&lt;br /&gt;1. Look for privacy policies on the web&lt;br /&gt;2. Clear your cache memory browsing.&lt;br /&gt;3. Encrypt your E-mail&lt;br /&gt;4. Get a separate email account for personal email and work email.&lt;br /&gt;5. Use anonymizers while browsing.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Security Issues&lt;/strong&gt;&lt;br /&gt;Data should be secure and accurate – Without security, can have good privacy policies but hackers gain entry – Without accuracy, wrong decisions are made about individuals.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-7850745231402312803?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/7850745231402312803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=7850745231402312803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7850745231402312803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7850745231402312803'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/privacy-in-technology.html' title='Privacy in Technology'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-7768040968764578972</id><published>2008-11-09T19:52:00.005-06:00</published><updated>2008-11-09T20:03:02.003-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cyber Security and Computer Ethics'/><title type='text'>Chapter-6 Anatomy of the Problem from Cyber Security and Computer Ethics</title><content type='html'>There are approximately 30,000 hacker-oriented websites that disclose hacker know-how and tips on how to create computer viruses or “bugs.” One virus, the Manila-generated “Love Bug,” virtually circumnavigated the globe in twelve hours, illustrating that a teenager with Internet access in an underdeveloped nation can wreak as much cyberspace havoc as a privileged teenager in a developed nation.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Computer N/w Infrastructure Weakness and Vulnerabilities&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;The regular 3-way TCP\IP Handshake has been depicted below:&lt;br /&gt;&lt;/strong&gt;1. Client---------SYN Packet-------------Host&lt;br /&gt;2. Host-----------SYN\ACK Packet--------Clien&lt;br /&gt;3. Client----------ACK Packet---------------Host&lt;br /&gt;The Three way handshake established the trust relationship between the client and the host.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;IP Spoofing&lt;/strong&gt;&lt;br /&gt;Spoofing is the creation of TCP/IP packets using somebody else's IP address. Routers use the "destination IP" address in order to forward packets through the Internet, but ignore the "source IP" address. That address is only used by the destination machine when it responds back to the source.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TCP SYN ATTACK&lt;/strong&gt;&lt;br /&gt;Also known as ‘Half Open Scanning’ because only half of the complete 3-way TCP\IP connection is established.&lt;br /&gt;Client-----SYN Packet--- Host&lt;br /&gt;Case I: (Open) Host-----SYN\ACK Packet-- Client&lt;br /&gt;Case 2: (Closed) Host----RST\ACK Packet---- Client&lt;br /&gt;&lt;br /&gt;In this attack the client continually sends and receives the ACK packets but it does not open the session. The server holds these sessions open, awaiting the final packet in the sequence. This cause the server to fill up the available connections and denies any requesting clients access.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;TCP Sequence Number Attack&lt;/strong&gt;&lt;br /&gt;This is when the attacker takes control of one end of a TCP session. The goal of this attack is to kick the attacked end of the network for the duration of the session. Only then will the attack be successful. Each time a TCP message is sent the client or the server generates a sequence number. The attacker intercepts and then responds with a sequence number similar to the one used in the original session. This attack can then hijack or disrupt a session. If a valid sequence number is guessed the attacker can place himself between the client and the server. The attacker gains the connection and the data from the legitimate system. The only defense of such an attack is to know that it’s occurring&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Distributed Denial of Service Attacks (DDoS)&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;A distributed denial of service attack (DDOS) is one in which an attacker first compromises a number of hosts, and installs a daemon on those hosts. At a later point, the attacker sends a request to the daemon on the compromised hosts asking it to begin flooding a target host with various types of packets.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ping of Death Attack&lt;/strong&gt;&lt;br /&gt;Ø The maximum packet size allowed to be transmitted by TCP\IP on a network is 65 536 bytes.&lt;br /&gt;Ø In the Ping of Death Attack, a packet having a size greater than this maximum size allowed by TCP\IP is sent to the target system.&lt;br /&gt;Ø As soon as the target system receives a packet exceeding the allowable size, then it crashes, reboots or hangs.&lt;br /&gt;Ø This attack can easily be executed by the ‘ping’ command as follows:&lt;br /&gt;ping -l 65540 hostname&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Smurf Attacks&lt;br /&gt;&lt;/strong&gt;1. In SMURF Attacks, a huge number of Ping Requests are sent to the Target system, using Spoofed IP Addresses from within the target network.&lt;br /&gt;2. Due to infinite loops thus generated and due to the large number of Ping Requests, the target system will crash, restart or hang up.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Tear Drop Attack&lt;/strong&gt;&lt;br /&gt;Data sent from the source to the destination system, is broken down into smaller fragments at the source system and then reassembled into larger chunks at the destination system.&lt;br /&gt;&lt;em&gt;For Example:&lt;/em&gt;&lt;br /&gt;Say data of 4000 bytes is to be sent across a network, then it is broken down into three chunks:&lt;br /&gt;CHUNK A contains Bytes 1 to 1500.&lt;br /&gt;CHUNK B contains Bytes 1501 to 3000&lt;br /&gt;CHUNK C contains Bytes 3001 to 4000&lt;br /&gt;1. In this example the range of CHUNK A is 1 to 1500, range of CHUNK B is 1501 to 3000 while the range of CHUNK C is 3001 to 4000.&lt;br /&gt;2. However, in case of a Teardrop attack, these ranges of data chunks are overlapping. For Example, in case of a Teardrop attack, the same 4000 bytes would be broken down into the below three chunks:&lt;br /&gt;CHUNK A contains Bytes 1 to 1500.&lt;br /&gt;CHUNK B contains Bytes 1499 to 3000&lt;br /&gt;CHUNK C contains Bytes 2999 to 4000&lt;br /&gt;3. In this example the range of CHUNK A is 1 to 1500; range of CHUNK B is 1499 to 3000 while the range of CHUNK C is 2999 to 4000. Thus, the ranges are overlapping.&lt;br /&gt;4. Since here the ranges are overlapping, the target system gets DOS!!!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Windows NT Registry Threats&lt;/strong&gt;&lt;br /&gt;Common NT Registry attacks include the L0pht Crack, the Chargen Attack, the SSPing/ JOLT, and the Red Button.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-7768040968764578972?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/7768040968764578972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=7768040968764578972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7768040968764578972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7768040968764578972'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/11/chapter-6-anatomy-of-problem-from-cyber.html' title='Chapter-6 Anatomy of the Problem from Cyber Security and Computer Ethics'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-6579872236969365417</id><published>2008-10-23T21:58:00.003-05:00</published><updated>2008-10-23T22:35:13.869-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Seminar on Hacking'/><title type='text'>Seminar on Hacking Powerpoint Presentation</title><content type='html'>&lt;div id="__ss_686526" style="WIDTH: 425px; TEXT-ALIGN: left"&gt;&lt;a title="Hacking" style="DISPLAY: block; MARGIN: 12px 0px 3px; FONT: 14px Helvetica,Arial,Sans-serif; TEXT-DECORATION: underline" href="http://www.slideshare.net/bewise/hacking-presentation-686526?type=powerpoint"&gt;Hacking&lt;/a&gt;&lt;object style="MARGIN: 0px" height="355" width="425"&gt;&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=hacking-1224807880385377-9&amp;amp;stripped_title=hacking-presentation-686526"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=hacking-1224807880385377-9&amp;stripped_title=hacking-presentation-686526" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="FONT-SIZE: 11px; PADDING-TOP: 2px; FONT-FAMILY: tahoma,arial; HEIGHT: 26px"&gt;View SlideShare &lt;a title="View Hacking on SlideShare" style="TEXT-DECORATION: underline" href="http://www.slideshare.net/bewise/hacking-presentation-686526?type=powerpoint"&gt;presentation&lt;/a&gt; or &lt;a style="TEXT-DECORATION: underline" href="http://www.slideshare.net/upload?type=powerpoint"&gt;Upload&lt;/a&gt; your own. (tags: &lt;a style="TEXT-DECORATION: underline" href="http://slideshare.net/tag/keyloggers"&gt;keyloggers&lt;/a&gt; &lt;a style="TEXT-DECORATION: underline" href="http://slideshare.net/tag/ping"&gt;ping&lt;/a&gt;)&lt;/div&gt;&lt;/div&gt;&lt;a href="http://www.slideshare.net/bewise/hacking-presentation-686526"&gt;SlideShare Link&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="VISIBILITY: hidden; WIDTH: 0px; HEIGHT: 0px" height="0" src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bHQ9MTIyNDgxNjg4MDA2MiZwdD*xMjI*ODE3MTAzNjA5JnA9MTAxOTEmZD*mbj1ibG9nZ2VyJmc9MSZ*PSZvPTY2YzM1NTQxNWJkZTRiNjM5MzNjMzJmM2Q*YTg3MDA4.gif" width="0" border="0" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-6579872236969365417?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/6579872236969365417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=6579872236969365417' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6579872236969365417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/6579872236969365417'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/10/seminar-on-hacking-powerpoint.html' title='Seminar on Hacking Powerpoint Presentation'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-4741755999929391217</id><published>2008-10-19T18:59:00.004-05:00</published><updated>2008-10-19T19:11:41.942-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Midterm Questions and Answers on Computer Security'/><title type='text'>Midterm Questions and Answers on Computer Security</title><content type='html'>&lt;a title="Permanent Link to Chapter-5 Cyberspace Infrastructure (Summary) from Computer Network Security and Cyber Ethics" href="http://techwasim.blogspot.com/2008/10/chapter-5-cyberspace-infrastructure.html"&gt;Chapter-5 Cyberspace Infrastructure from Computer Network Security and Cyber Ethics&lt;/a&gt;&lt;br /&gt;1. &lt;strong&gt;Explain in detail TCP/IP Protocol Architecture&lt;br /&gt;&lt;em&gt;TCP/IP has Four Layers:&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Application Layer:&lt;/strong&gt;&lt;/em&gt; Application layer protocols are those used for the exchange of user information. Protocol uses here are Simple Mail Transfer Protocol (SMTP), Hypertext Transfer Protocol (HTTP), File Transfer Protocol (FTP), Simple Network Management Protocol (SNMP) etc.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Host-to-Host Transport Layer:&lt;/strong&gt;&lt;/em&gt; The core protocols of the Transport layer are Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP).&lt;br /&gt;TCP provides a one-to-one, connection-oriented, reliable communications service.&lt;br /&gt;UDP provides a one-to-one or one-to-many, connectionless, unreliable communications service.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Internet Layer:&lt;/strong&gt;&lt;/em&gt; The Internet layer is responsible routing of IP packet. The core protocols of the Internet layer are IP, ARP (Address Resolution Protocol, ICMP (Internet Control Message Protocol), and IGMP (Internet Group Management Protocol).&lt;br /&gt;The Internet Protocol (IP) is a routable protocol responsible for IP addressing, routing, and the fragmentation and reassembly of packets.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Network Interface Layer:&lt;/strong&gt;&lt;br /&gt;&lt;/em&gt;The Network Interface layer (also called the Network Access layer) is responsible for placing TCP/IP packets on the network medium and receiving TCP/IP packets off the network medium.&lt;br /&gt;&lt;em&gt;Hardware Devices:&lt;/em&gt; Hubs, Switch, Bridge etc hardware devices used here.&lt;br /&gt;&lt;br /&gt;2. &lt;strong&gt;Write short notes on Ethernet.&lt;/strong&gt;&lt;br /&gt;Ethernet is a frame-based computer networking technology for local area networks (LANs). It is Network of two or more Computers.&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Standard Name:&lt;/strong&gt;&lt;/em&gt; IEEE 802.3 Local Area Network (LAN) protocols.&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Protocol:&lt;/strong&gt;&lt;/em&gt; data are transmitted using the popular Carrier-Sense Multiple Access/Collision Detection (CSMA/CD) protocol&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Ethernet Technologies:&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;Three data rates are currently defined for operation over optical fiber and twisted-pair cables. They are:&lt;br /&gt;1. 10 Mbps - 10Base-T Ethernet (IEEE 802.3)&lt;br /&gt;2. 100 Mbps - Fast Ethernet (IEEE 802.3u)&lt;br /&gt;3. 1000 Mbps - Gigabit Ethernet (IEEE 802.3z)&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;Ethernet Network Elements:&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;Ethernet LANs consist of network nodes and interconnecting media. The network nodes fall into two major classes:&lt;br /&gt;1. Data terminal equipment (DTE)&lt;br /&gt;2. Data communication equipment (DCE)&lt;br /&gt;&lt;br /&gt;&lt;a title="Permanent Link to Chapter-4 Morality, Technology and Value (Summary) from Computer Network Security and Cyber Ethics" href="http://techwasim.blogspot.com/2008/10/chapter-4-morality-technology-and-value.html"&gt;Chapter-4 Morality, Technology and Value from Computer Network Security and Cyber Ethics&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;Define Technology and list three components of Technological process?&lt;br /&gt;Technology &lt;/strong&gt;is a rational process of creating a means to order and transform matter, energy, and information to realize certain valued ends.&lt;br /&gt;Technological processes have three components: Inputs, Engines and Outputs.&lt;br /&gt;&lt;br /&gt;2. &lt;strong&gt;How to make good use of Technology?&lt;br /&gt;&lt;/strong&gt;Value of any technology depends on how we use the technology. Every technology should have a regulated policy. New Laws to strengthen, new moral and ethical concepts and massive education campaign to make good use of technology.&lt;br /&gt;&lt;br /&gt;&lt;a title="Permanent Link to Chapter-1 All Security Involves Trade-offs (Summary) from Beyond Fear" href="http://techwasim.blogspot.com/2008/10/chapter-1-all-security-involves-trade_17.html"&gt;Chapter-1 All Security Involves Trade-offs from Beyond Fear&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;1. &lt;strong&gt;List 5-step process to analyze and evaluate security systems, technologies, and practices&lt;/strong&gt;.&lt;br /&gt;The Five Steps process are as follows:&lt;br /&gt;1. What assets are you trying to protect?&lt;br /&gt;2. What are the risks to these assets?&lt;br /&gt;3. How well does the security solution mitigate those risks?&lt;br /&gt;4. What other risks does the security solution cause?&lt;br /&gt;5. What costs and trade-offs does the security solution impose?&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Define Attack and Assets&lt;br /&gt;Attack&lt;/strong&gt; means intentional unwarranted actions. An attack is a specific way to attempt to break the security of a system or a component of a system.&lt;br /&gt;&lt;strong&gt;Assets&lt;/strong&gt; are the objects of attack. Assets can be as small as a single diamond and as&lt;br /&gt;large as a nation’s infrastructure.&lt;br /&gt;&lt;br /&gt;&lt;a title="Permanent Link to Chapter-2 Security Trade-offs Are Subjective (Summary) from Beyond Fear" href="http://techwasim.blogspot.com/2008/10/chapter-2-security-trade-offs-are.html"&gt;Chapter-2 Security Trade-offs Are Subjective from Beyond Fear&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Define Threat and Risk.&lt;br /&gt;Threat:&lt;/strong&gt; A potential way an attacker can attack a system.&lt;br /&gt;&lt;strong&gt;Risk:&lt;/strong&gt; A likelihood of threat and seriousness of successful attack.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Define Risk Management.&lt;br /&gt;&lt;/strong&gt;It’s figuring out which attacks are worth worrying about and which ones can be ignored. “Threat determines the risks, and the risks determine the countermeasures”.&lt;br /&gt;&lt;br /&gt;&lt;a title="Permanent Link to Chapter-3 Security Trade-offs depend on power and agenda (Summary) from Beyond Fear" href="http://techwasim.blogspot.com/2008/10/chapter-3-security-trade-offs-depend-on.html"&gt;Chapter-3 Security Trade-offs depend on power and agenda (Summary) from Beyond Fear&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Why do we need proxies for easy security trade-offs?&lt;br /&gt;Proxies&lt;/strong&gt; are the players who act in the interest of other players. Proxies are the intermediate person that has specializations in their field. Everyone can’t do everything. So proxies are needed.&lt;br /&gt;For E.g.: Hiring a building inspector to evaluate the physical condition of house. This cannot be done by everyone unless you are having expertise in it.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Which are the two players that create security problems?&lt;br /&gt;&lt;/strong&gt;Attacker and the Attack (Assets owner) are the two players that create security problems. If no attacker than there would be no security problems.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Questions from Cryptography Presentation&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1. Explain Public key Cryptography or Asymmetric Cryptography&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Public key Cryptography&lt;/strong&gt; was introduced by Diffie and Hellman in 1976, where each person gets a pair of keys, called the public key and the private key. Each person's public key is shared while the private key is kept secret known only to the recipient of the message. Messages are encrypted using the intended recipient's public key and can only be decrypted using his private key. Communications involve only public keys, and no private key is ever transmitted or shared.It is called asymmetric encryption because it uses two keys i.e. public key and a private key.&lt;br /&gt;E.g.: RSA encryption, PGP (Pretty Good Privacy)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2. Explain Private Key Cryptography or Symmetric Key Cryptography&lt;br /&gt;Private Key Cryptography&lt;/strong&gt; is a cryptographic method in which the same key is used to encrypt and decrypt the message. It also called Symmetric encryption because it uses only singe key. Symmetric-key cryptography is sometimes called as secret-key cryptography&lt;br /&gt;A problem with private-key cryptography is that the sender and the recipient of the message must agree on a common key via some alternative secure channel.&lt;br /&gt;E.g.: Data Encryption Standard (DES), triple-DES (3DES), Advanced Encryption Standard (AES).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-4741755999929391217?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/4741755999929391217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=4741755999929391217' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4741755999929391217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4741755999929391217'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/10/midterm-exam-questions-from-computer.html' title='Midterm Questions and Answers on Computer Security'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-1773160944897572983</id><published>2008-10-17T01:29:00.004-05:00</published><updated>2008-10-17T14:22:35.621-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computer N/W Security and Cyber Ethics Ch-5'/><title type='text'>Chapter-5 Cyberspace Infrastructure (Summary) from Computer Network Security and Cyber Ethics</title><content type='html'>&lt;div align="justify"&gt;&lt;strong&gt;Protocols:&lt;/strong&gt; A set of rules and conventions for sending information over a network.&lt;br /&gt;&lt;strong&gt;Computer Communication Networks:&lt;br /&gt;&lt;/strong&gt;A computer communication network system consists of hardware, software and human ware&lt;br /&gt;&lt;strong&gt;Hardware:&lt;br /&gt;&lt;em&gt;Host:&lt;/em&gt;&lt;/strong&gt; Each computer in a network is known as host. Each host has a unique hostname and IP address assign to it.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Network Elements:&lt;/em&gt;&lt;/strong&gt; Hubs, Bridges, Routers and Gateways are used to connect the host/hosts on the network.&lt;br /&gt;&lt;strong&gt;Software:&lt;/strong&gt;&lt;br /&gt;All application software that are required to configure the network elements for successful networking.&lt;br /&gt;&lt;strong&gt;Humanware:&lt;br /&gt;&lt;/strong&gt;Users who connect with different host/hosts and share resources on the network.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Network Types:&lt;/strong&gt;&lt;br /&gt;In general there are three types of Network:&lt;br /&gt;1. &lt;strong&gt;&lt;em&gt;LAN:&lt;/em&gt;&lt;/strong&gt; Local Area Network. It covers a small room to a large building. High speed connectivity with low cost setup.&lt;br /&gt;2. &lt;strong&gt;&lt;em&gt;MAN:&lt;/em&gt;&lt;/strong&gt; Metropolitan Area Network. It covers a city or 10-15 miles in range.&lt;br /&gt;3. &lt;strong&gt;&lt;em&gt;WAN:&lt;/em&gt;&lt;/strong&gt; Wide Area Network. Covers large geographical areas. Requires routers, switch etc costly device to setup.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Network Topology:&lt;br /&gt;&lt;/strong&gt;1. &lt;strong&gt;&lt;em&gt;WAN Network:&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;1. &lt;em&gt;Mesh Topology:&lt;/em&gt; Each node is connected with more than one host. Interconnected links result in network reliability in case of any failure nodes.&lt;br /&gt;2. &lt;em&gt;Tree Topology:&lt;/em&gt; Generalization of Bus Topology. Root node is at that highest level and other nodes share parent-child relationship. Transmission from any element in the network propagates through the network and is received by all elements in the network.&lt;br /&gt;2. &lt;strong&gt;LAN Network:&lt;br /&gt;&lt;/strong&gt;1. &lt;em&gt;Bus Topology:&lt;/em&gt; Only one element in the network can have control of the bus at any one time. Failure of one node can bring down whole network.&lt;br /&gt;2. &lt;em&gt;Star Topology:&lt;/em&gt; All elements in a network are connected with a central element such as hub or switch.&lt;br /&gt;3. &lt;em&gt;Ring Topology:&lt;/em&gt; Token ring technology is used for transmitting data on the network.&lt;br /&gt;&lt;strong&gt;Ethernet:&lt;/strong&gt;&lt;br /&gt;&lt;em&gt;Standard Name:&lt;/em&gt; IEEE 802.3 Local Area Network (LAN) protocols.&lt;br /&gt;&lt;em&gt;Protocol:&lt;/em&gt; data are transmitted using the popular Carrier-Sense Multiple Access/Collision Detection (CSMA/CD) protocol&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Ethernet Technologies:&lt;br /&gt;&lt;/em&gt;&lt;/strong&gt;10 Mbps - 10Base-T Ethernet (IEEE 802.3)&lt;br /&gt;100 Mbps - Fast Ethernet (IEEE 802.3u)&lt;br /&gt;1000 Mbps - Gigabit Ethernet (IEEE 802.3z)&lt;br /&gt;10-Gigabit - 10 Gbps Ethernet (IEEE 802.3ae).&lt;br /&gt;&lt;strong&gt;Transmission Control Systems:&lt;br /&gt;&lt;/strong&gt;The concept of representation of data for transmission, either as an analog or a digital signal, is called an encoding scheme.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Two Types of Encoding:&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;1. &lt;em&gt;Digital to Analog Encoding:&lt;/em&gt; It carries Sine wave with a Carrier signal. A Carrier signals has Amplitude, Frequency, and Phase shift.&lt;br /&gt;2. &lt;em&gt;Digital to Digital Encoding:&lt;/em&gt; Information is converted into bits i.e. zeros and ones.&lt;br /&gt;&lt;strong&gt;Transmission Media:&lt;br /&gt;&lt;/strong&gt;It has two Categories&lt;br /&gt;1. &lt;em&gt;Wired Transmission:&lt;/em&gt; Fiber Optics cable, Twisted pair cable, Co-axial cables are used.&lt;br /&gt;2. &lt;em&gt;Wireless Transmission:&lt;/em&gt; Radio wave communication, Laser beam, Microwave and Infrared.&lt;br /&gt;&lt;strong&gt;Connecting Devices:&lt;br /&gt;&lt;em&gt;HUB:&lt;/em&gt;&lt;/strong&gt; Hub is a broadcasting device. It connects LAN components with identical protocols.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Bridges:&lt;/em&gt;&lt;/strong&gt; Bridges filter incoming data packets, known as frames, for address before they are forwarded.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Switches:&lt;/em&gt;&lt;/strong&gt; Intelligent devices that are also known as high-performance bridges.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Routers:&lt;/em&gt;&lt;/strong&gt; Perform routing of IP packets. Routers interconnect two of more heterogeneous networks.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Gateways:&lt;/em&gt;&lt;/strong&gt; They provide translation between networking technologies such as OSI model and TCP/IP protocol stack. A router with added translation functionality is a gateway.&lt;br /&gt;&lt;strong&gt;Communication Service:&lt;br /&gt;&lt;em&gt;Connection Oriented:&lt;/em&gt;&lt;/strong&gt; Three-way handshake to transfer data over a network. Acknowledgements of packet send and received. E.g.: TCP/IP protocol&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Connectionless:&lt;/em&gt;&lt;/strong&gt; No Handshaking. No Acknowledgement of packet sends or received. E.g.: UDP protocol&lt;br /&gt;&lt;strong&gt;Data Switching:&lt;br /&gt;&lt;em&gt;Circuit Switching:&lt;/em&gt;&lt;/strong&gt; Networks reserve the resources needed for the communication session before the session begins.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Packet Switching:&lt;/em&gt;&lt;/strong&gt; Do not require any resources to be reserved before a communication session begins.&lt;br /&gt;&lt;strong&gt;OSI Model and TCP/IP Model:&lt;/strong&gt;&lt;br /&gt;OSI model functions as the network communication protocol standard, but it is not widely used. TCP/IP is widely used. Both model use two protocol stacks, one at source and destination.&lt;br /&gt;&lt;strong&gt;OSI Model has Seven Layers:&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Application Layer:&lt;/em&gt;&lt;/strong&gt; Protocol use here are SMTP, HTTP, FTP, SNMP etc&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Presentation Layer:&lt;/em&gt;&lt;/strong&gt; It responds to service requests from the Application Layer and issues service requests to the Session Layer.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Session Layer:&lt;/em&gt;&lt;/strong&gt; It establishes, manages and terminates the connections between the local and remote application.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Transport Layer:&lt;/em&gt;&lt;/strong&gt; TCP and UDP protocol are use here.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Network Layer:&lt;/em&gt;&lt;/strong&gt; Routing of IP packet.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Data Link Layer:&lt;/em&gt;&lt;/strong&gt; Switches and Bridges are used here.&lt;br /&gt;&lt;strong&gt;Physical Layer:&lt;/strong&gt; Bits of zeros and ones are converted here. Hub is used at this layer.&lt;br /&gt;&lt;strong&gt;TCP/IP has Five Layers:&lt;br /&gt;&lt;em&gt;Application Layer:&lt;/em&gt;&lt;/strong&gt; Protocol use here are SMTP, HTTP, FTP, SNMP etc&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Transport Layer:&lt;/em&gt;&lt;/strong&gt; TCP and UDP protocol are use here.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Network Layer:&lt;/em&gt;&lt;/strong&gt; Routing of IP packet.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Data Link Layer:&lt;/em&gt;&lt;/strong&gt; Switches and Bridges are used here.&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Physical Layer:&lt;/em&gt;&lt;/strong&gt; Bits of zeros and ones are converted here. Hub is used at this layer.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-1773160944897572983?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/1773160944897572983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=1773160944897572983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1773160944897572983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/1773160944897572983'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/10/chapter-5-cyberspace-infrastructure.html' title='Chapter-5 Cyberspace Infrastructure (Summary) from Computer Network Security and Cyber Ethics'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-7779037721249757044</id><published>2008-10-17T01:23:00.001-05:00</published><updated>2008-10-17T14:22:49.398-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Computer N/W Security and Cyber Ethics Ch-4'/><title type='text'>Chapter-4 Morality, Technology and Value (Summary) from Computer Network Security and Cyber Ethics</title><content type='html'>&lt;div align="justify"&gt;&lt;strong&gt;Technology&lt;/strong&gt; is a rational process of creating a means to order and transform matter, energy, and information to realize certain valued ends. Technological processes have three components: Inputs, Engines and Outputs.&lt;br /&gt;&lt;strong&gt;Value&lt;/strong&gt; of any technology depends on how we use the technology. Our Value systems are scaled on good and bad technologies.&lt;br /&gt;The value we derive from the technology and the value we used in decision making while using the technology is based on one’s beliefs and Moral Value system.&lt;br /&gt;&lt;strong&gt;Moral Dilemmas, Decision Making, and Technology&lt;/strong&gt;&lt;br /&gt;A dilemma is a difficult choice, not just any difficulty or problem. Dilemmas are usually caused by advances in technology. Advances in computer technology create a multitude of possibilities that never existed before.&lt;br /&gt;&lt;strong&gt;Making Good Use of Technology&lt;br /&gt;&lt;/strong&gt;Every technology should have a regulated policy. New Laws to strengthen, new moral and ethical concepts and massive education campaign make good use of technology.&lt;br /&gt;&lt;strong&gt;Strengthening the Legal System&lt;/strong&gt;&lt;br /&gt;Many laws on the books are in serious need of review and revision. Updating the legal system is complex task. Relevant and needed laws should be created quickly.&lt;br /&gt;&lt;strong&gt;Moral and Ethics Education&lt;br /&gt;&lt;/strong&gt;1. Formal Education: Formal education of ethics should start in elementary schools. One should teach the use of computers and the Internet responsibly. Not giving personal information and identification, should not create and distribute viruses, download copyrighted materials off the Internet, or misuse the technology etc.&lt;br /&gt;2. Advocacy: Advocacy is a mass education strategy works with public, corporations and governments to enhance public education through awareness. It is intended to make people part of the message.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-7779037721249757044?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/7779037721249757044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=7779037721249757044' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7779037721249757044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/7779037721249757044'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/10/chapter-4-morality-technology-and-value.html' title='Chapter-4 Morality, Technology and Value (Summary) from Computer Network Security and Cyber Ethics'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-8695229757303461258</id><published>2008-10-17T01:15:00.001-05:00</published><updated>2008-10-17T01:17:56.815-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Beyond Fear Chapter-3'/><title type='text'>Chapter-3 Security Trade-offs depend on power and agenda (Summary) from Beyond Fear</title><content type='html'>&lt;div align="justify"&gt;A &lt;strong&gt;Player &lt;/strong&gt;means different parties, each with his or her subjective perceptions of risk, tolerances for living with risk, and willingness to make various trades-offs.&lt;br /&gt;An &lt;strong&gt;Agenda &lt;/strong&gt;means players own analysis of the security situation and internal and external non-security considerations.&lt;br /&gt;Two Players that create security problems: &lt;em&gt;Attacker&lt;/em&gt; and the &lt;em&gt;Attack&lt;/em&gt; (Assets owner). If no attacker than there would be no security problems.&lt;br /&gt;A &lt;strong&gt;policy&lt;/strong&gt; of security system is defined by a single player to many players. House policy is defined by a single person whereas the corporate and credit card system policy requires role of many players. A policy may be simple or complex depends upon the unit.&lt;br /&gt;&lt;strong&gt;Proxies&lt;/strong&gt; are the players who act in the interest of other players. Proxies are the intermediate person that has specializations in their field. Everyone can’t do everything. So proxies are needed.&lt;br /&gt;For E.g.: Hiring a building inspector to evaluate the physical condition of house. This cannot be done by everyone unless you are having expertise in it.&lt;br /&gt;·  &lt;strong&gt;Security Theater:&lt;/strong&gt; security countermeasures that provide the feeling of security instead of the reality.&lt;br /&gt;E.g.: Taper-resistant packaging. It’s easy to poison many foods and over the counter medicines right through the seal by using a syringe.&lt;br /&gt;· Nokia spends far more on battery security than on communications security. Battery security system senses when a 3rd-party battery is used and switches into maximum power-consumption, wearing the battery down faster, thus insuring that consumers stick to Nokia batteries.&lt;br /&gt;· In economics, &lt;strong&gt;externality&lt;/strong&gt; occurs when one player's decision affects other players not involved in the decision.&lt;br /&gt;For E.g.: A company saves much money by dumping toxic waste in a river, and everyone suffers because of contaminated water.&lt;br /&gt;· Security system is based on a policy defined by one or more of the players (usually the asset owner) and the perceived risk against those assets. Security will always be a balancing game between various players and their agendas.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-8695229757303461258?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/8695229757303461258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=8695229757303461258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/8695229757303461258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/8695229757303461258'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/10/chapter-3-security-trade-offs-depend-on.html' title='Chapter-3 Security Trade-offs depend on power and agenda (Summary) from Beyond Fear'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-5315972539294515474</id><published>2008-10-17T01:10:00.003-05:00</published><updated>2008-10-17T01:14:15.373-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Beyond Fear Chapter-2'/><title type='text'>Chapter-2 Security Trade-offs Are Subjective (Summary) from Beyond Fear</title><content type='html'>&lt;p align="justify"&gt;&lt;strong&gt;Security Trade-offs is Subjective:&lt;/strong&gt;&lt;br /&gt;Risk assessment is subjective&lt;br /&gt;People’s basic desire or values are subjective. Security decisions are based on personal judgments.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Extreme trade-offs are easy:&lt;br /&gt;&lt;/strong&gt;Protect yourself from credit card fraud by never using a credit card.&lt;br /&gt;Prevent yourself from Mad Cow Disease by never eating meat products.&lt;br /&gt;Prevent terrorists from boarding on planes by grounding all planes.&lt;br /&gt;&lt;br /&gt;Swiss door locks on homes are secure and hard to pick. Lock has a key that can't be easily duplicated by common equipment. The key can only be duplicated by lock manufacturer at written request of property owner. So generally, many Swiss families have only 1 or 2 house keys.&lt;br /&gt;&lt;br /&gt;Most shoplifting takes place in fitting rooms. If we remove fitting rooms, resulting decrease in profits from sales would be greater than the cost of shoplifting.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Threat:&lt;/strong&gt; A potential way an attacker can attack a system.&lt;br /&gt;&lt;strong&gt;Risk:&lt;/strong&gt; A likelihood of threat and seriousness of successful attack.&lt;br /&gt;&lt;strong&gt;Risk Management:&lt;/strong&gt; It’s figuring out which attacks are worth worrying about and which ones can be ignored.&lt;br /&gt;“Threat determines the risks, and the risks determine the countermeasures”.&lt;br /&gt;&lt;br /&gt;Different people &amp;amp; organizations have different tolerances for risk, making value judgments about the risk. Because of this fact, security is subjective and will be different for different people, as each one determines his own risk and evaluates the trade-offs for different countermeasures.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Perceived risk and Actual risks:&lt;/strong&gt;&lt;br /&gt;1. People exaggerate dramatic but rare risks and downplay common risks. We worry more about earthquakes, terrorism, &amp;amp; kidnappers instead of slipping in our bathroom.&lt;br /&gt;2. People have trouble estimating risks for anything that is not normal to them.&lt;br /&gt;3. Personified risks are seen as greater than anonymous risks.&lt;br /&gt;4. People underestimate risks they take willingly and overestimate risks they can't control.&lt;br /&gt;5. People overestimate risks that are publicized.&lt;br /&gt;Rapid advance of Technology and its getting more complicated and specialized, that it has become impossible for normal person to learn everything they need to know about all the risks.&lt;br /&gt;"Because we do not understand the risks, we make bad security trade-offs."&lt;br /&gt;If the trade-offs were subjective, there would be no such thing as a bad trade-off, only a trade-off perceived to be bad by someone. Security policy is based on the agenda of the major players.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-5315972539294515474?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/5315972539294515474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=5315972539294515474' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5315972539294515474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5315972539294515474'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/10/chapter-2-security-trade-offs-are.html' title='Chapter-2 Security Trade-offs Are Subjective (Summary) from Beyond Fear'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-5934195998253049958</id><published>2008-10-17T01:08:00.001-05:00</published><updated>2008-10-17T01:09:31.558-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Beyond Fear Chapter-1'/><title type='text'>Chapter-1 All Security Involves Trade-offs (Summary) from Beyond Fear</title><content type='html'>&lt;div align="justify"&gt;· This book is about how to analyze and evaluate security measures.&lt;br /&gt;· Most of the time, we hear about the security when it fails. Security effectiveness can be extremely hard to measure.&lt;br /&gt;· Beyond Fear is Schneier attempt to demystify security for the post 9/11 general public. The 9/11 terrorist operation was small, efficient, relatively low-tech, very strictly disciplined, highly compartmentalized, and extremely innovative.&lt;br /&gt;· We constantly make security trade-offs every day. Like brushing teeth, locking the house, the car we purchase and drive, candy bar we buy etc&lt;br /&gt;· People make security trade-offs naturally, choosing more or less security as situations change.&lt;br /&gt;· The goal of this book is to help you move beyond fear, and give you the tools to start making sensible security trade-offs.&lt;br /&gt;· Security is both a feeling and a reality.&lt;br /&gt;· Security is about preventing adverse consequences from the intentional and unwarranted actions of others.&lt;br /&gt;1. Security system: set of things put in place or done to prevent negative consequences. Security is about prevention. It can be attacked, can have flaws, and can fail.&lt;br /&gt;2. Security concerns itself with intentional actions. Safety means protecting assets from unintentional actions. Security means preventing assets from intentional actions.&lt;br /&gt;3. Security requires the concept of an attacker who performs intentional and unwarranted actions.&lt;br /&gt;4. An attack means intentional unwarranted actions. An attack is a specific way to attempt to break the security of a system or a component of a system.&lt;br /&gt;5. Assets are the objects of attack. Assets can be as small as a single diamond and as large as a nation’s infrastructure.&lt;br /&gt;6. A countermeasure means individual, discrete, &amp;amp; independent security components which together make up a security system.&lt;br /&gt;· Security is complex that can be broken down into smaller and simpler steps. The 5-step process to analyze and evaluate security systems, technologies, and practices are as follows:&lt;br /&gt;1. What assets are you trying to protect?&lt;br /&gt;2. What are the risks to these assets?&lt;br /&gt;3. How well does the security solution mitigate those risks?&lt;br /&gt;4. What other risks does the security solution cause?&lt;br /&gt;5. What costs and trade-offs does the security solution impose?&lt;br /&gt;· A better understanding of trade-offs leads to a better understanding of security, and consequently to more sensible security decisions.&lt;br /&gt;· Two Schneier's concepts:&lt;br /&gt;1. Everyone involved in a security decision has their own agenda.&lt;br /&gt;2. Every security decision involves tradeoffs.&lt;br /&gt;· By understanding these concepts, we can make rational decisions about whether and how proposed security measures should be implemented, rather than being driven by fear.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-5934195998253049958?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techwasim.blogspot.com/feeds/5934195998253049958/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5604649628460881387&amp;postID=5934195998253049958' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5934195998253049958'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/5934195998253049958'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2008/10/chapter-1-all-security-involves-trade_17.html' title='Chapter-1 All Security Involves Trade-offs (Summary) from Beyond Fear'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-4818002383161874527</id><published>2007-10-17T23:16:00.002-05:00</published><updated>2008-11-16T23:33:53.921-06:00</updated><title type='text'>Contact Us</title><content type='html'>E-MAIL: techwasim@yahoo.com &lt;br /&gt;&lt;br /&gt;We would recommend you to contact us by using the information below, all enquiries, questions and feedbacks are answered promptly. We're right here if you need us. Please get in touch to find out more about this blog and how you can help us to promote the site.&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt; id = 10693; &lt;/script&gt;&lt;br /&gt;&lt;script src="http://kontactr.com/wp.js" type="text/javascript"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-4818002383161874527?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4818002383161874527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/4818002383161874527'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2007/10/contact-us-form.html' title='Contact Us'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author></entry><entry><id>tag:blogger.com,1999:blog-5604649628460881387.post-3200140398135741483</id><published>2007-10-17T04:13:00.003-05:00</published><updated>2008-11-16T20:40:58.770-06:00</updated><title type='text'>About</title><content type='html'>My name is Wasim Rangoonwala and I have experience in computers and electronics. I am Graduate in Bachelors of Engineering in Information Technology and currently persuing Masters in Computer Science.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;SKILLS, INTEREST AND ACTIVITIES:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;• To work on IT enable services.&lt;br /&gt;• Software Developing in JAVA, C, C++, ASP.net.&lt;br /&gt;• Website Developing.&lt;br /&gt;• Databases Oracle, My SQL, SQL.&lt;br /&gt;• Networking.&lt;br /&gt;• Extensive experience with PCs and Macs:&lt;br /&gt;• Web 2.0 Tools: The Social Web, Blogging Software, Wikis, Widgets, RSS Readers&lt;br /&gt;• Microsoft Office suite&lt;br /&gt;• Dreamweaver&lt;br /&gt;• HTML/XHTML, CSS&lt;br /&gt;• Adobe Professional Suite&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;About this Blog&lt;br /&gt;&lt;/strong&gt;I had been thinking about starting a blog for some time, and finally i took initiative on 17 October 2008. I decided to start a technical blog where I would share my knowledge with others.&lt;br /&gt;&lt;br /&gt;I created this site to help others to solve technical problems through easy to understand posts. Many posts contain step-by-step instructions to solve a problem, while also including screenshots or code samples.&lt;br /&gt;&lt;br /&gt;I will discuss topics such as Programming, Networking, Cell Phones, Blogger, Consumer Electronics, Windows, Databases, Computer Security, Hacking, Javascript and much more about Latest Technology.&lt;br /&gt;&lt;br /&gt;I hope you will have great time in reading my post.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Contact Me&lt;br /&gt;&lt;/strong&gt;You can contact me at techwasim@yahoo.com if you would like:&lt;br /&gt;&lt;br /&gt;• Like me to publish a post with regards to a technical question. A problem or question about one of my current posts.&lt;br /&gt;&lt;br /&gt;Note:I will not respond to spam or harmful e-mails. Those will be deleted without reservation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5604649628460881387-3200140398135741483?l=techwasim.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/3200140398135741483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5604649628460881387/posts/default/3200140398135741483'/><link rel='alternate' type='text/html' href='http://techwasim.blogspot.com/2007/10/about-us.html' title='About'/><author><name>Wasim</name><uri>http://www.blogger.com/profile/10939170899371397666</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_DO7Ne847YXY/SSogotB0uNI/AAAAAAAAABA/Red3Lqe4oBw/S220/Wasim.jpg'/></author></entry></feed>
