COMP 102 Final Review #1
1. Explain how the design of a web service exhibits modularity. Be specific (include in your
explanation some of the parts of a web service).
Modularity: ability to break something into meaningful components that themselves can
be understood separately
Web service: system that serves information over the internet
Front end (serves requests), back end database (manages the data itself)
They are modules bc they can run by themselves but work together for ultimate
2. What is an algorithm?
Sequence of steps that solves a problem
3. What is the difference between a syntax and a semantic error in a program?
Syntax: done something illegal within the language - typos
Semantic: when the code runs but there’s a logical flaw so it doesn’t do what you want
4. Answer the following questions about the code below.
a. What files are used in this program?
b. What format does definitions most likely have?
c. Why is the variable “defs” not a particularly good choice of variable name?
Def is a key word in python and they are similar so it may get confusing
d. What is this code (most likely) supposed to do?
Print the definitions of all the words
e. It’s quite likely that this code isn’t going to work as intended. It has to do with the
way the file word1 is being loaded. What’s wrong? Be specific.