Variable definitions are also useful to build spreadsheets in DrScheme. Consider the following example: <#1579#>;; A Lemonade Stand<#1579#>
<#1580#>(define<#1580#> <#1581#>quantity<#1581#> <#1582#>100)<#1582#>
<#1583#>(define<#1583#> <#1584#>price<#1584#> <#1585#>.15)<#1585#>
<#1586#>(define<#1586#> <#1587#>var-cost<#1587#> <#1588#>.07)<#1588#>
<#1589#>(define<#1589#> <#1590#>fixed-cost<#1590#> <#1591#>2.0)<#1591#>
<#1592#>;; ---------------------<#1592#>
<#1593#>(define<#1593#> <#1594#>gross<#1594#> <#1595#>(*<#1595#> <#1596#>quantity<#1596#> <#1597#>price))<#1597#>
<#1598#>(define<#1598#> <#1599#>cost<#1599#> <#1600#>(+<#1600#> <#1601#>fixed-cost<#1601#> <#1602#>(*<#1602#> <#1603#>quantity<#1603#> <#1604#>var-cost)))<#1604#>
<#1605#>(define<#1605#> <#1606#>net<#1606#> <#1607#>(-<#1607#> <#1608#>gross<#1608#> <#1609#>cost))<#1609#>
Each variable in the program is like a cell in a worksheet program, but our ``cells'' have mnemonic variable names with a precise meaning. In the example, the variables above the line stand for the given numbers, and the variables below the line define the dependencies. By editing a given, we can examine various scenarios. For example, by changing <#60508#><#1613#>(define<#1613#>\ <#1614#>price<#1614#>\ <#1615#>.15)<#1615#><#60508#> to <#60509#><#1616#>(define<#1616#>\ <#1617#>price<#1617#>\ <#1618#>.20)<#1618#><#60509#>, we can examine the net profit for 20-cent glasses of lemonade instead of 15-cent glasses. Use a small number of such exercises if your students have difficulties understanding variables. If there is demand, we will put up some exercises that Ms.\ Karen Buras used in her spread-sheet class.<#70668#>