Brandon is considering renting a luxury car or an SUV for se…
Brandon is considering renting a luxury car or an SUV for several days. A luxury car costs $130 for the first 3 days plus $50 for each additional day. An SUV costs $190 for the first 4 days plus $45 for each additional day. Find the number of days for which the rental cost of the luxury car will be the same as the rental cost of the SUV.
Read DetailsA man goes on a diet starting after New Year’s Day. The tabl…
A man goes on a diet starting after New Year’s Day. The table below gives his weight, W, at t number of weeks after January 1. Use the information in this table to answer the questions below. Weeks after Jan 1 Weight 0 208 2 200 3 196 5 188 a) Find the rate of change (slope) of his weight. _______ b) What are the units for this slope? _______ c) What is the vertical intercept of the linear model created with this data? _______ d) Predict the man’s weight after 11 weeks. _______
Read DetailsConsider the following code snippet: def sort(values: list[i…
Consider the following code snippet: def sort(values: list[int]) -> None: for i in range(1, len(values)) : j = i while j > 0 and values[j-1] > values[j] : swap( values, j – 1, j ) j = j – 1 What sort algorithm is used in this code?
Read DetailsSuppose you have the following function and another function…
Suppose you have the following function and another function — moo(m) (not shown) — that runs in O(log n). What is the Big‑O runtime of the goo function shown below? def goo(widgets: list[Widget]) -> None: for x in widgets: moo(x)
Read DetailsConsider the following “odd” implementation of a list contai…
Consider the following “odd” implementation of a list contains method: def bizarre_contains(a: list[float], key: float) -> bool: for i in range(0, len(a)): if key in a: return True return False What’s the Big O runtime for bizzare_contains?
Read Details