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

Respuesta :

Answer:

Explanation:

Part (a):

Statement : The number of siblings you have

Suitable Data type : Byte

Typical Value : From -128 and up to 127

Explanation: Byte data type is the most suitable since it can covers minimum and maximum number of siblings one can have.

Part (b):

Statement : Your final grade in this class

Suitable Data type : Char

Typical Value : 1 byte

Explanation: Grades is in the form of alphabetical letter which is either A, B, C, D, F or E which can be stored in character data type.

Part (c):

Statement : Population of Earth

Suitable Data type : Long

Maximum Value : 9223372036854775807

Explanation: Long Data takes up to 8 bytes and can store up to 9223372036854775807 which can cater for more than 36 billion. The population of earth is only around 7 billion currently making Long data type the most suitable data type to store earth population.

Part (d):

Statement : Population of US Country

Suitable Data type : Integer

Typical Value :2147483647

Explanation: Integer data type takes up to 4 bytes and can store up to  2147483647 making it suitable to store U.S population.

Part (e):

Statement : The number of passengers on bus

Suitable Data type : Byte

Typical Value :From -128 up to 127

Explanation: The typical maximum number of passengers of a bus are only around 72. Byte data type is the most suitable since it can cater the number up to 127.

Part (f):

Statement : Player's score in a Scrabble game

Suitable Data type : Short

Typical Value : 32767

Explanation: The maximum point can be scored in the Scrabble game is only 830 therefore the most suitable data type for this case is the short data type.

Part (g):

Statement : One team's score in a Major League Baseball game

Suitable Data type : Byte

Typical Value : From -128 up to 127

Explanation: The maximum point can be scored in the Base ball game is only 49 therefore the most suitable data type for this case is the Byte data type since it can cater up to 127.

Part (h):

Statement : The year an historical event occurred

Suitable Data type : Short

Maximum Value: 32767

Explanation: The historic event year can be any number from 1 to 2020 therefore the most suitable data type is the short data type.

Part (i):

Statement : The number of legs on an animal

Suitable Data type : Short

Maximum Value: 32767

Explanation: The most number of legs found are 750 legs therefore the most suitable data type is the short data type which can cater up to 32767.

Part (j):

Statement : The Price of an automobile

Suitable Data type : Float

Maximum Value: 340282350

Explanation: The most expensive car is around 15 million therefore the most suitable data type is the float data type which can cater up to 340 million.  

As per the question the best data type for following so that a reasonable value is accommodated as per the type of example.

  • The number of siblings The number of siblings you have, Data type: Byte and has a Value: From -128 and up to 127
  • The final grade in class, Data type: Char, Value: 1 byte
  • Statement Population of the Earth, Data type: Long. Value: 9223372036854775807.
  • The statement of Population of US Country, Data type: Integer, Value 2147483647.
  • The statement:  passengers on the bus, Data type: Byte, Value: From -128 up to 127. The statement of scrabble game, type: Short, Value: 32767.

Learn more about the data type for each.

brainly.com/question/24871576.