138k views
3 votes
I need help with a question on a computer science test.

Three of the following values could be stored as strings. When would you NOT use a string command?

To store decimal values.

To store a list of colors.

To store a word.

To store values NOT used for calculations.

User Lichenbo
by
5.7k points

2 Answers

7 votes

Answer:

To store decimal vaules is the correct choice.

User Jocel
by
5.8k points
3 votes

Answer:

To store decimal values

Step-by-step explanation:

Analyzing the given options.

(a)

Decimal values are digits and are to be treated as such. So, storing them as strings mean that they are no longer decimal values.

(b), (c) & (d)

List of colors, words and values that can't be used for calculations are all string values.

Take a for instance.

List of colors: "Red", "Yellow", "Blue",...

Words, "I", "am", "a", "boy"

Values that can't be used for calculations are non numerical data and as such, some of them could be strings.

Hence:

Option (a) answers the question

User Josh Young
by
5.3k points