Question: Choose the best data type for each of the following so that any reasonable value is accommodated but no memory storage is wasted. Give an

Choose the best data type for each of the following so that any reasonable value is accommodated but no memory storage is wasted. Give an example of a typical value that would be held by the variable, and explain why you chose the type you did.
a. The number of siblings you have
b. Your final grade in this class
c. The population of Earth
d. The population of a U.S. county
e. The number of passengers on a bus
f. One player’s score in a Scrabble game
g. One team’s score in a Major League Baseball game
h. The year an historical event occurred
i. The number of legs on an animal
j. The price of an automobile

Step by Step Solution

3.42 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a For most people the value is no more than 10 or 12 so the number would easily fit in a byte If you ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!