1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tanzania [10]
3 years ago
5

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
Engineering
1 answer:
stiks02 [169]3 years ago
3 0

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.  

You might be interested in
What is the first test you should do when checking the charging system?
yan [13]

Answer:

Connect the test light in series with the negative post, and start pulling feed wires. The first to check is the heavy charging wire from the alternator. A bad or leaky diode in an alternator is a very common source of overnight battery drain. Connect wires one at a time to see what lead is drawing current.

8 0
2 years ago
Which group might be classified as a gang?
Furkat [3]

Answer:

The following criteria are commonly used for classifying groups as gangs: The group has three or more members, generally aged 12–24. Members share an identity, typically linked to a name, and often other symbols. Members view themselves as a gang, and they are recognized by others as a gang.

Explanation:

8 0
3 years ago
Read 2 more answers
Energy transfer in mechanical systems: During steady-state operation, a mechanical gearbox receives 70 KW of input power through
Degger [83]

Answer:

Heat transfer rate(Q)= 1.197kW

Power output(W)=68.803kW

3 0
3 years ago
Steam enters a turbine at 8000 kPa, 440oC. At the exit, the pressure and quality are 150 kPa and 0.19, respectively.
levacccp [35]

Answer:

\dot W_{out} = 3863.98\,kW

Explanation:

The turbine at steady-state is modelled after the First Law of Thermodynamics:

-\dot Q_{out} -\dot W_{out} + \dot m \cdot (h_{in}-h_{out}) = 0

The specific enthalpies at inlet and outlet are, respectively:

Inlet (Superheated Steam)

h_{in} = 3353.1\,\frac{kJ}{kg}

Outlet (Liquid-Vapor Mixture)

h_{out} = 890.1\,\frac{kJ}{kg}

The power produced by the turbine is:

\dot W_{out}=-\dot Q_{out} + \dot m \cdot (h_{in}-h_{out})

\dot W_{out} = -2.93\,kW + (1.57\,\frac{kg}{s} )\cdot (3353.1\,\frac{kJ}{kg} - 890.1\,\frac{kJ}{kg} )

\dot W_{out} = 3863.98\,kW

8 0
3 years ago
The following data were obtained when a cold-worked metal was annealed. (a) Estimate the recovery, recrystallization, and grain
Oduvanchick [21]
Sorrry needdddd pointssssss
7 0
2 years ago
Other questions:
  • When the vessel and its contents are warmed to 100 °C, Q decomposes into its constituent elements. What is the total pressure, a
    11·1 answer
  • Anyone know sebastian from bb
    8·1 answer
  • A refrigerator has a cooling load of 50 kW. It has a COP of 2. It is run by a heat engine which consumes 50 kW of heat to supply
    12·1 answer
  • the frequencies 10, 12, 23 and 45 Hz. (a) What is the minimum sampling rate required to avoid aliasing? (b) If you sample at 40
    13·1 answer
  • A block of ice weighing 20 lb is taken from the freezer where it was stored at -15"F. How many Btu of heat will be required to c
    15·1 answer
  • MCQ : What are the main the constituents of acid rains?
    10·2 answers
  • Find the general solution of the equation<br>a) Tan A = 1/√3​
    11·1 answer
  • When nondeterminism results from multiple threads attempting to access a shared resource such as a shared variable or a shared f
    9·1 answer
  • Identify the prefixes used in the International System of
    15·1 answer
  • a metal rod 24mm diameter and 2m long is subjected to an axial pull of 40 kN. If the rod is 0.5mm, then find the stress-induced
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!