[Year 12 IT Apps] Pseudocode intro

Mark KELLY kel at mckinnonsc.vic.edu.au
Thu Aug 11 15:25:58 EST 2011


Hi all. While reading up on Google Docs scripts, I found their introduction
to pseudocode. It's a nice "real world" example of it that kids might
understand.

http://code.google.com/googleapps/appsscript/guide_writing_scripts.html

In case you can't get to it, it reads in part:

Planning a Script

When you're planning a script, you'll find it helpful to write
*pseudocode*first. Pseudocode is a precise and detailed narrative
version of what the
script needs to do. You use pseudocode to help you determine how many
functions your script needs, where you need loops and counters, where you
need variables, and where to perform different calculations. Here's
pseudocode for the stock price script.

first function runs when Spreadsheet is opened

read the current Spreadsheet into a variable
define menu entries
define menu name

second function does most of the work in the Spreadsheet

read the current Spreadsheet into a variable
set the column labels

define a counter called row
start a while true loop
use an if loop to test whether there's a stock symbol in the current
row first column

write data to the log
look up the stock symbol
write the stock information in the correct column of each row that has
a stock symbol
write data to the log
increment the counter

The more detail you put in the pseudocode, the easier it will be to write
the script.


-- 
Mark Kelly
Manager of ICT, Reporting, IT Learning Area
McKinnon Secondary College
McKinnon Rd McKinnon 3204, Victoria, Australia
Direct line / Voicemail: +613 8520 9085, Fax +613 9578 9253
kel at mckinnonsc.vic.edu.au
VCE IT Lecture Notes: http://vceit.com
Moderator: IT Applications Edulist <http://www.edulists.com.au/>

Want a good time? Call 0112358. Ask for Mr Fibonacci.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.edulists.com.au/pipermail/itapps/attachments/20110811/e7e6ba79/attachment.html 


More information about the itapps mailing list