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
Suppose you have two arrays: Arr1 and Arr2. Arr1 will be sorted values. For each element v in Arr2, you need to write a pseudo c
brilliants [131]

Answer:

The algorithm is as follows:

1. Declare Arr1 and Arr2

2. Get Input for Arr1 and Arr2

3. Initialize count to 0

4. For i in Arr2

4.1 For j in Arr1:

4.1.1 If i > j Then

4.1.1.1 count = count + 1

4.2 End j loop

4.3 Print count

4.4 count = 0

4.5 End i loop

5. End

Explanation:

This declares both arrays

1. Declare Arr1 and Arr2

This gets input for both arrays

2. Get Input for Arr1 and Arr2

This initializes count to 0

3. Initialize count to 0

This iterates through Arr2

4. For i in Arr2

This iterates through Arr1 (An inner loop)

4.1 For j in Arr1:

This checks if current element is greater than current element in Arr1

4.1.1 If i > j Then

If yes, count is incremented by 1

4.1.1.1 count = count + 1

This ends the inner loop

4.2 End j loop

Print count and set count to 0

<em>4.3 Print count</em>

<em>4.4 count = 0</em>

End the outer loop

4.5 End i loop

End the algorithm

5. End

6 0
3 years ago
2 times 4 - 3 times 5​
Papessa [141]

Answer:

<h3>The answer is - 7</h3>

Explanation:

The statement above is written as

2 × 4 - 3 × 5

8 - 15

= - 7

Hope this helps you

4 0
4 years ago
Read 2 more answers
A Simply supported wood beam with overhang is subjected to uniformly distributed load q. The beam has a rectangular cross sectio
irinina [24]

Answer:

q = 61.71 KN/m

Explanation:

We know that shear force at one end of the beam is;

F = wl/2

Where;

w is the uniformly distributed load and l is the span.

Thus, in this question, q is the distributed load, so;

F = ql/2

Area of beam section = breadth x depth

In this case,

Area = 200 × 250 = 50000 mm²

We are given allowable shear stress of τa=1.8MPa. This can also be written as τa = 1.8 N/mm²

We know that formula for average shear stress is;

τ_avg = Force/Area

Thus, Force = τ_avg x Area

However, we are given maximum allowable shear stress as 1.8and we know that; τ_max = 1.5 × τ_avg

Thus, τ_avg = 1.8/1.5 = 1.2

Hence;

Force = 1.2 × 50,000 = 60000 N

We need

So from the earlier equation F = ql/2,we can get; 60000 = ql/2

ql = 120000 - - - - - (1)

Now, to the bending stress, we know that section modulus of a rectangular section is;

Z = bd²/6

So,for this question, we have;

Z = (200 × 250²)/6

Z = 2083333.33 mm²

Maximum bending moment of a simply supported beam is wl²/8

So,in this case, M = ql²/8

So,formula for maximum bending stress = M/Z

So, plugging in the values, we have ;

σ_max = (ql²/8) / 2083333.33

We are given σ= 14 MPa or 14 N/mm²

Thus;

14 = (ql²/8) / 2083333.33

ql² = 14 × 2083333.33 × 8

ql² = 233333332.96 - - - eq(2)

From equation 1,we saw that;ql = 120000.

Putting this for ql in equation 2,we will get;

120000l = 233333332.96

l = 233333332.96/120000

l = 1944.44 mm

So from eq 1,q = 120000/l

q = 120000/1944.44

q = 61.71 KN/m

6 0
3 years ago
9. A vehicle is having routine maintenance performed.
dexar [7]

Answer: b

Explanation:

8 0
3 years ago
Two kilograms of air within a piston-cylinder assembly execute a Carnot power cycle with maximun1 and minimum temperatures of 75
ExtremeBDS [4]

Answer:

The Answer and Explanation is in the folloing attachment  

Explanation:

                                     

8 0
4 years ago
Other questions:
  • The transfer function of a typical tape-drive system is given by
    10·1 answer
  • An alloy in the A-B system is 40% B and is within the α + β two phase field, where the a phase contains 5% B and the β phase con
    11·1 answer
  • Which of the following is true about the n-way analysis of variance (ANOVA)?
    6·1 answer
  • You live on a street that runs East to West. You just had 2 inche of snow and you live on the North side of the street. You retu
    14·1 answer
  • 0il with a relative density of 0,8 flows in a pipe of diameter 60 mm. A venturi meter having a throat diameter of 35 mm is insta
    11·1 answer
  • How do I put a picture on here for my graph equation??
    10·2 answers
  • Which statement is true about what will happen when the example code runs?1: main PROC2: mov edx,03: mov eax,404: push eax5: cal
    10·1 answer
  • Investigative personalities prefer to work with:
    9·1 answer
  • What energy transformation takes place when you turn on a light
    8·1 answer
  • Discuss the microstrucral transformation of eutectic reaction, hypo-eutecticand hyper eutectic. Including temperature, reactions
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!