CSC148 ch 1-4 (midterm review) Study
Terms & Questions with Complete
solutions
what to do when error occurs: - ANSWER 1. fail silently (do nothing)
2. raise user_defined exception (child of the Exception class)
3. add __str__ to the new exception to customize the message
linkedlist - ANSWER -list stores items in contiguous slots
-many shifts must be made to remove/add items
-contains many _Node objects that have a value
traversing through a linkedlist - ANSWER curr = self._first
while curr is not None:
curr.item...
curr = curr.next
how to have more than one line in one cell - ANSWER "ALT ; Enter"
add days to a date WITHOUT weekends - ANSWER =WORKDAY(start date cell, number of days
you want to add)
Enter a function based off of information from a table - ANSWER =VLOOKUP(cell of what you're
trying to lookup, entire table you are referencing, column number, FALSE (exact value) or TRUE
(closest match))
Function for monthly mortgage payment - ANSWER go to formulas tab and under financial
click "PMT"
, =PMT(interest rate / # of payments/year, # of payments/year * # of years, current value
of loan)
make sure to put a negative sign to make function positive.
How to use excel feature to change data in order to meet specified conditions - ANSWER select
data tab; then click "what if analysis"; then goal seek tab
IF statement function - ANSWER =IF(logical test, [value if true], [value if false]
Determine ranking based on information - ANSWER =RANK.EQ(cell you want ranked, range of
cells you're ranking, 0-descending or 1-ascending)
Percent Change Formula - ANSWER new-old/old
Cumulative Income - ANSWER =SUM(first number of sequence you want to add $$$: cell)
MAKE SURE TO USE ":" NOT ","
"is" - ANSWER same id
alias - ANSWER refer to the same value. eg. variable argument and parameter
header - ANSWER first line of function. aka signature
primitive type - ANSWER can just use type name. eg. int, float, str, bool, None
compound type - ANSWER must import typing for compound type classes. other types can
be contained in compound type. eg. Tuple[str,List[int]] is something like ('hello', [0, 1])
Tuple - ANSWER type that can store a collection but is non-mutable
Terms & Questions with Complete
solutions
what to do when error occurs: - ANSWER 1. fail silently (do nothing)
2. raise user_defined exception (child of the Exception class)
3. add __str__ to the new exception to customize the message
linkedlist - ANSWER -list stores items in contiguous slots
-many shifts must be made to remove/add items
-contains many _Node objects that have a value
traversing through a linkedlist - ANSWER curr = self._first
while curr is not None:
curr.item...
curr = curr.next
how to have more than one line in one cell - ANSWER "ALT ; Enter"
add days to a date WITHOUT weekends - ANSWER =WORKDAY(start date cell, number of days
you want to add)
Enter a function based off of information from a table - ANSWER =VLOOKUP(cell of what you're
trying to lookup, entire table you are referencing, column number, FALSE (exact value) or TRUE
(closest match))
Function for monthly mortgage payment - ANSWER go to formulas tab and under financial
click "PMT"
, =PMT(interest rate / # of payments/year, # of payments/year * # of years, current value
of loan)
make sure to put a negative sign to make function positive.
How to use excel feature to change data in order to meet specified conditions - ANSWER select
data tab; then click "what if analysis"; then goal seek tab
IF statement function - ANSWER =IF(logical test, [value if true], [value if false]
Determine ranking based on information - ANSWER =RANK.EQ(cell you want ranked, range of
cells you're ranking, 0-descending or 1-ascending)
Percent Change Formula - ANSWER new-old/old
Cumulative Income - ANSWER =SUM(first number of sequence you want to add $$$: cell)
MAKE SURE TO USE ":" NOT ","
"is" - ANSWER same id
alias - ANSWER refer to the same value. eg. variable argument and parameter
header - ANSWER first line of function. aka signature
primitive type - ANSWER can just use type name. eg. int, float, str, bool, None
compound type - ANSWER must import typing for compound type classes. other types can
be contained in compound type. eg. Tuple[str,List[int]] is something like ('hello', [0, 1])
Tuple - ANSWER type that can store a collection but is non-mutable