EGR 102 final exam questions with
complete solutions6
What is an array and how is it used? - ANSWERS-An array is an ordered series or arrangement of
numbers or characters. Arrays can be used to
store information that you can get to and work
with using a computer
What does the following array look like?
sample=[32, 43, 51; 23, 13, 64; 10, 11, 12] - ANSWERS-3 rows, 3 column array
Why are bugs in program sometimes hard to detect? - ANSWERS-Bugs are sometimes hard to
find because they do not
necessarily result in an error message; they may not
even show up for all inputs (they can be inside an if
statement for example that you don't get to); and
they are not always easy to find by just looking at the
code.
What are some strategies for finding out the root cause of program/system problems? -
ANSWERS-Strategies from your ZyBook : Generate a testable
hypothesis, Use debug output statements, use a
binary search strategy or a logic tree to break the
problem into parts to eliminate a lot of potential
paths.
, If I put a thermistor or photoresistor into a voltage divider, what are the key design parameters
and what do I want in a good design? - ANSWERS-Key design parameters: the resistor in the
other
spot should be approximately the same number
of ohms as the sensor in mid
range, so there is plenty of room for the voltage to go both up and down as resistance changes.
The location
(position R1 or R2) will determine if the output
increases or decreases with the item being
sensed.
In that system what happens as the resistance of the sensor changes? - ANSWERS-Given a
voltage divider, the output Vout will go
up and down with changes in R2's resistance, and
opposite the changes in R1's resistance.
Given the following first line of a function can you identify the parts: function [gcd] =
euclid( a,b ) - ANSWERS-gcd is output parameter, a & b are input parameters,
and the name is euclid
How would I call this function from inside a program, given the same a and b, if I wanted to
have a variable FACTOR that holds the answer from the function. - ANSWERS-From the
command line>> euclid(100,20)
What are some functions that exist in MATLAB that we have used this semester and how do you
know they are functions? - ANSWERS-FACTOR=euclid(100,20);
complete solutions6
What is an array and how is it used? - ANSWERS-An array is an ordered series or arrangement of
numbers or characters. Arrays can be used to
store information that you can get to and work
with using a computer
What does the following array look like?
sample=[32, 43, 51; 23, 13, 64; 10, 11, 12] - ANSWERS-3 rows, 3 column array
Why are bugs in program sometimes hard to detect? - ANSWERS-Bugs are sometimes hard to
find because they do not
necessarily result in an error message; they may not
even show up for all inputs (they can be inside an if
statement for example that you don't get to); and
they are not always easy to find by just looking at the
code.
What are some strategies for finding out the root cause of program/system problems? -
ANSWERS-Strategies from your ZyBook : Generate a testable
hypothesis, Use debug output statements, use a
binary search strategy or a logic tree to break the
problem into parts to eliminate a lot of potential
paths.
, If I put a thermistor or photoresistor into a voltage divider, what are the key design parameters
and what do I want in a good design? - ANSWERS-Key design parameters: the resistor in the
other
spot should be approximately the same number
of ohms as the sensor in mid
range, so there is plenty of room for the voltage to go both up and down as resistance changes.
The location
(position R1 or R2) will determine if the output
increases or decreases with the item being
sensed.
In that system what happens as the resistance of the sensor changes? - ANSWERS-Given a
voltage divider, the output Vout will go
up and down with changes in R2's resistance, and
opposite the changes in R1's resistance.
Given the following first line of a function can you identify the parts: function [gcd] =
euclid( a,b ) - ANSWERS-gcd is output parameter, a & b are input parameters,
and the name is euclid
How would I call this function from inside a program, given the same a and b, if I wanted to
have a variable FACTOR that holds the answer from the function. - ANSWERS-From the
command line>> euclid(100,20)
What are some functions that exist in MATLAB that we have used this semester and how do you
know they are functions? - ANSWERS-FACTOR=euclid(100,20);