Suppose you need to accommodate measurements in inches and centimeters on your new Web site. Both units need to be accurate to two decimal places. The maximum length you need to represent is 50.05 inches.

a. How many characters do you need to represent the maximum value in
inches?
b. How many characters do you need to represent the maximum value in
centimeters

a. 5 characters, including the decimal point.
b. 50.05 inches * 2.54 cm/inch = 127.127 cm, which is 7 characters including the decimal point, but the specification said that accuracy would only be to two decimal places. So the maximum length would be 6 characters.

Computer Science & Information Technology

You might also like to view...

Polygons are described most specifically as:

a) odd-sided shapes b) multi-sided shapes c) six-sided shapes d) None of the above.

Computer Science & Information Technology

The strcopy() function causes each element of string2 to be assigned to the equivalent element of string1 until the ____ is encountered.

A. end-of-string marker B. newline marker C. end-of-file marker D. a square bracket

Computer Science & Information Technology