Question 1 of 10
A math library documents: abs(n) returns the absolute value of n. Which call returns 9?
- A. abs("nine")
- B. abs()
- C. abs(-9)
- D. abs(-9, 9)
A math library documents: abs(n) returns the absolute value of n. Which call returns 9?
API: swapCase(s) returns a new string with uppercase and lowercase letters swapped. Which call matches the documentation?
A list library documents: slice(list, start, end) returns a new list of elements from 1-based index start through end inclusive. For nums ← [10, 20, 30, 40], which call returns [20, 30]?
Which statement about software libraries is accurate?
Docs: min3(a, b, c) returns the smallest of three numbers. Which call returns 2?
A networking library documents: checksum(bytes) returns an integer check value for list bytes. A student wants a check value for [7, 3, 1]. Which call matches?
The table documents two procedures from a color library.
| Procedure | Returns |
|---|---|
| rgb(r, g, b) | a color value from red, green, blue components 0-255 |
| gray(level) | a gray color with equal RGB components equal to level |
Which call creates a gray color with level 128?
A program needs sine values. A math library provides sin(degrees). What should the programmer do first?
Docs: padLeft(s, width, ch) returns s padded on the left with character ch until the result has length width. Which call yields "00ab" if LENGTH("ab") is 2 and width is 4?
Using a library procedure mainly helps a programmer by: