Liberty and Accessibility

Friday, September 14, 2007

making decisions

In the last installment of the Ron Paul programming tutorial, you
learned how to get input from the user. As an example, we wrote a
program to ask the user who their favorite presidential candidate was.
However, the program didn't do much except print to the screen who
their pick was. Obviously, you would want to do something more than
that. One way to do this is by using if/else statements. If a user
picks Ron Paul, you could have the computer do one thing and if the
user picked Fred Thompson or Hillary Clinton, you could have the
computer warn the user that those candidates are members of the Counsel
on Foreign Relations. I think the best way to demonstrate this is with
an example.
'begining of code'
dim presidential_candidate as string
print "Who is your favorite presidential candidate?"
input presidential_candidate
if presidential_candidate="Ron Paul" then
print "Oh good, you believe in freedom."
elseif presidential_candidate="Hillary Clinton" or
presidential_candidate="Fred Thompson" then
beep
beep
beep
beep
beep
print "WARNING! WARNING! WARNING!"
print "The candidate you have picked is a member of an organization
called the Counsel on Foreign Relations."
print "This organization is dangerous to American sovereignty because
they believe in one-world government."
print "You should google Ron Paul sometime."
else
print "I don't know who that is."
print "My programmer was too lazy to program all of the presidential
candidates into me."
end if
'end of code'

--
Email services provided by the System Access Mobile Network. Visit

www.serotek.com to learn more about accessibility anywhere.

0 Comments:

Post a Comment

<< Home


 
Read the Bills Act Coalition Add to Technorati Favorites