Solution Manual for Introduction to Mechatronic Design Do Not Circulate
Chapter 4 Programming Languages
4.1) Describe the differences between an interpreter and a compiler.
An interpreter interprets (that is, extracts the meaning of the programmer) from every line of a program just
4.2) Explain how this line of BASIC code tests the state of bit 2:
10 IF ((V/4)-((V/8)*2)) = 1
4.3) True or False: It is easy to improve the performance of a program written in an interpreted language by
selectively coding in assembly language.
4.4) True or False: Assembly language is considered a high-level language.
4.5) When is the meaning of a compiled program converted into actions?
4.6) True or False: Assembly language and machine language are synonymous.
False. While it may be a common usage, it is sloppy to treat these two terms as synonymous. Assembly
4.7) Which of the languages described in this chapter was designed to teach programming?
4.8) Which are the object-oriented languages described in this chapter?
4.9) Describe a scenario in which programming in an interpreted language might be an advantage.
Debugging untested hardware. In this situation, the interactive nature of the interpreted environment could
4.10) Describe two similarities between Java and the PBASIC language used by the BASIC Stamp.
4.11) Name at least three other widely-used computer languages that were not mentioned in this chapter.
COBOL (still used in some business applications over 50 years after it was invented).
4.12) You are beginning to test a new circuit in which a microcontroller is connected to a large number of
peripheral devices – a process commonly referred to as “bring-up”. What language(s) would you choose
for this task? Why?
4.13) You are writing final production code for a microcontroller used to control a servomotor. What
language(s) would be reasonable choices for this application? Why?