Exercise 1

advertisement
Exercise L3
Referring to Matching.java and Unify.java, please make a program that can take input
(weather states: sunny, cloud, or raining) and output the corresponding statement (do
not take umbrella, depending on the weather forecast, take an umbrella)
(hints: use variable ?weather to match with the weather states)
If (?weather = sunny) then “do not take umbrella”
If (?weather = cloud) then “depending on the weather forecast”
If (?weather = raining) then “take an umbrella”
(Optional exercise): Extend your program that can take input dynamically from a
weather forecast site or database and remind a person to take an umbrella if it
is raining or is going to rain according to the weather forecast data acquired.
Reference on XML
http://rhlab.cis.k.hosei.ac.jp/
Download