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
saveliy_v [14]
3 years ago
12

Assume you are programming an embedded microcontroller in C and want your code to follow good software engineering practices, be

as portable as possible, and not be wasteful of memory. You need to select a variable that can hold an integer from 0 to 132. What is the best choice for the variable type?
Engineering
2 answers:
Olegator [25]3 years ago
5 0

Answer:

unsigned char

Explanation:

Selecting best data type depends upon the application. Memory and portability are some of the considerations while selecting a data type.

For the given scenario, we need to store an integer in the range of 0 to 132.

Lets have a look at some of the options available for variable data types.

Type: signed char

storage size: 1 byte

Range: -128 to 127

Type: unsigned char

storage size: 1 byte

Range: 0 to 255

Type: int

storage size: 2 byte

Range: -32,768 to 32,767

Unsigned char would be best choice since we need to store only positive integers and it gives us range 0 to 255 which is more than enough for our case and storage size is also least. Other data types are simply too big to consider for this scenario and hence they will be a wasteful of memory.

Please note that the name of data type is "char" but that doesn't mean that we cannot store integer values in it. In-fact in embedded micro-controller environment, char is often used for storing one byte integers.

insens350 [35]3 years ago
4 0

Answer:

unsigned char

Explanation:

The different data types with their sizes and range are given as follows,

  • char - 1 byte - Value: -128 - 127
  • unsigned char- 1 byte - Value: 0 - 255

All other data types including integers, float, double require 2 bytes or more. Therefore, the data type with the smallest size that can hold values from 0 to 132 is unsigned char.

You might be interested in
A wastewater plant discharges a treated effluent (w) with a flow rate of 1.1 m^3/s, 50 mg/L BOD5 and 2 mg/L DO into a river (s)
4vir4ik [10]

A wastewater plant discharges a treated effluent (w) with a flow rate of 1.1 m^3/s, 50 mg/L BOD5 and 2 mg/L DO into a river (s) with a flow rate of 8.7 m^3/s, 6 mg/L BOD5 and 8.3 mg/L DO. Both streams are at 20°C. After mixing, the river is 3 meters deep and flowing at a velocity of 0.50 m/s. DOsat for this river is 9.0 mg/L. The deoxygenation constant is kd= 0.20 d^-1 and The reaction rate constant k at 20 °C is 0.27 d^-1.

The answer therefore would be the number 0.27 divided by two and then square while getting the square you would make it a binomial.

I wont give the answer but the steps

Your Welcome

8 0
3 years ago
Select the correct answer.<br> Which equation gives you the amount of work performed?
Fantom [35]

Answer:

Hello

this is the answer

5 0
3 years ago
A beam has been fixed to the floor by the pin at B and the roller at A as shown in figure 1 below.​
ahrayia [7]
What figure below???
3 0
3 years ago
A 600-MW steam power plant, which is cooled by a nearby river, has a thermal efficiency of 54 percent. Determine the rate of hea
Gennadij [26K]

Answer:

\dot Q _{L} = 511.111 MW. Heat transfer can be higher if themal efficiency is lower.

Explanation:

The heat transfer rate to the river water is calculated by this expression:

\dot Q_{L} = \dot Q_{H} - \dot W

\dot Q_{L} = (\frac{1}{\eta_{th}}-1 )\cdot \dot W\\\dot Q_{L} = (\frac{1}{0.54}-1)\cdot (600 MW)\\\dot Q _{L} = 511.111 MW

The actual heat transfer can be higher if the steam power plant reports an thermal efficiency lower than expected.

8 0
4 years ago
1: asha started abusness with 30.000
svetoff [14.1K]

Answer:

Explanation:adrive with visual acutity of 20/30 can just decipher asing adistance 20ft from asing determine the maximum destance from the sing which drivers with the flowing visual acuities will able to see the same sing 20/15 20/50

4 0
3 years ago
Other questions:
  • A groundwater contains the following cations (expressed as the cation):
    5·2 answers
  • Consider 1.0 kg of austenite containing 1.15 wt% C, cooled to below 727C (1341F). (a) What is the proeutectoid phase? (b) How
    14·1 answer
  • How much work is performed if a 400 lb weight is lifted 10 ft ?
    8·1 answer
  • #5 Air undergoes an adiabatic compression in a piston-cylinder assembly from P1= 1 atm and Ti=70 oF to P2= 5 atm. Employing idea
    13·1 answer
  • A smoking lounge is to accommodate 19 heavy smokers. The minimum fresh air requirement for smoking lounges is specified to be 30
    11·1 answer
  • A satellite would have a mass of 270 kg on the surface of Mars. Determine the weight of the satellite in pounds if it is in orbi
    12·1 answer
  • Why do organisms differ in their methods of reproduction?
    5·2 answers
  • Select the best answer for the question.
    11·2 answers
  • A new approval process is being adapted by Ursa Major Solar. After an opportunity has been approved, the contract is sent to the
    9·1 answer
  • Question 8 (1 point)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!