Share this story
Close X
Switch to Desktop Site

Computerese for beginners

Here's what a True BASIC (Beginners All-purpose Computer Instruction Code) computer program listing looks like. This program computes the growth of a $10,000 savings account earning 8.5 percent annual interest. It gives the balance of the account each year until the balance has doubled. (Statements following the exclamation marks serve as documentation for the programmer, and are ignored by the computer.) ! Compute interest on a bank account. ! Stop when the money has doubled. ! LET money = 10,000 ! Start with $10,000 LET original = money ! Remember that as original amount LET interest = 8.5/100 ! Interest is 8.5 percent DO until money [is greater than or equal to] 2 x original ! Loop until money doubles PRINT years, money ! Print year and money LET years = years + 1 ! Keep track of how long LET money = money + (interest x money) ! Add in interest LOOP PRINT ``In''; years ; ``years, you'll have $''; money END -- 30 --

Follow Stories Like This
Get the Monitor stories you care about delivered to your inbox.