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]
2 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]2 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]2 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
Which branch of engineering studies the physical behavior of metallic elements?
olga55 [171]

Material engineering studies the physical behavior of metallic elements.

Answer: Option C

<u>Explanation: </u>

Material Engineering is the creation and learning about the materials at an atomic level. An engineers from this branch focus on material and model its characteristics using the computer.

Also, they combine the knowledge of solid-states, metallurgy, chemistry and ceramics to the application level. It also has a great role in building the future with the advancing study in nanotechnology, biotechnology, etc. Simply, these are meant to have vivid applications in future life.

6 0
3 years ago
Read 2 more answers
What financial arguments could you use to justify your proposed
Gnoma [55]

The recommendation to segregate FLTs and the workers are as follows:-1)Reputation of warehouse:- To be in the market the reputation of warehouse should be good,it can only happen when the worker of that warehouse is happy with the management looks after worker external and internal affairs. There should be two pathways one for vehicle and other for walking in which both can’t use vice versa.2)High Profitability:- When there is no incident or accident happens between the FLTs and the workers in the warehouse then off course the worker will be regular at work then there will be high profit .3)Insurance premium:- If there is zero accident happens in the ware house then there will no claim, the company will be in the profit..

7 0
2 years ago
What type of car engine is best for cold weather.
Komok [63]

Answer:Antifreeze/coolant

Explanation: keeps your engine cool in warm weather and keeps it from freezing up in the winter. A 50-50 mix of full strength coolant and water generally protects to around -30 degrees Fahrenheit. Make sure you check with the supplier or your owner's manual for the correct formulation

5 0
2 years ago
How does a motion sensor work?
Ahat [919]

Answer:

A motion sensor uses one or multiple technologies to detect movement in an area. When a sensor detects motion, it sends a signal to your security systems control panel, which connects to your monitoring panel system. This alerts you and the monitoring center to a potential threat in your home.

Hope It Helps You................

3 0
3 years ago
Problem 1: A catchment has the following Horton’s infiltration parameters: f0=280 mm/hr, fc=25 mm/hr and k = 2.5 hr-1 . For the
harkovskaia [24]

Answer:

Ponding will occur in 40mins

Explanation:

We say that the infiltration rate is the velocity or speed at which water enters into the soil. This often times is measured by the depth (in mm) of the water layer that can enter the soil in one hour. An infiltration rate of 15 mm/hour means that a water layer of 15 mm on the soil surface, will take one hour to infiltrate.

Consider checking attachment for the step by step solution.

6 0
3 years ago
Other questions:
  • What is a coarse-grained rock composed of intermediate plagioclase feldspar and pyroxene? a. graniteb. gabbro c. andesited. peri
    9·1 answer
  • A 150-lbm astronaut took his bathroom scale (aspring scale) and a beam scale (compares masses) to themoon where the local gravit
    9·1 answer
  • A 10-mm steel drill rod was heat-treated and ground. The measured hardness was found to be 290 Brinell. Estimate the endurance s
    14·1 answer
  • Refrigerant 134a enters a horizontal pipe operating at steady state at 40oC, 300 kPaand a velocity of 40 m/s. At the exit, the t
    13·1 answer
  • Block D of the mechanism is confined to move within the slot of member CB. Link AD is rotating at a constant rate of ωAD = 6 rad
    11·1 answer
  • What does Enter key do?
    10·1 answer
  • Drag each label to the correct location on the table. Match to identify permanent and temporary structures.
    15·1 answer
  • At what distance from the Earth’s surface is a 10,000 kg satellite if its potential energy is equal to –5.58 x 1011 J? (choose t
    5·1 answer
  • What major problems could you encounter in complex intersections?
    7·1 answer
  • The ratio between the modulating signal voltage and the carrier voltage is called?.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!