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
2. A thin vertical panel L = 3 m high and w = 1.5 m wide is thermally insulated on one side and exposed to a solar radiation flu
n200080 [17]

Answer: 383.22K

Explanation:

L = 3m, w = 1.5m

Area A = 3 x 1.5 = 4.5m2

Q' = 750W/m2 (heat from sun) ,

& = 0.87

Q = &Q' = 0. 87x750 = 652.5W/m2

E = QA = 652.5 x 4.5 = 2936.25W

T(sur) = 300K, T(panel) = ?

Using E = §€A(T^4(panel) - T^4(sur))

§ = Stefan constant = 5.7x10^-8

€ = emmisivity = 0.85

2936.25 = 5.7x10^-8 x 0.85 x 4.5 x (T^4(panel) - 300^4)

T(panel) = 383.22K

See image for further details.

5 0
3 years ago
What material property would still cause strain in a strain gauge that is positionedperpendicular to the direction of force if i
svetlana [45]

Answer:

oof

Explanation:

I don't know but please don't report me

I am trying to do a challenge

Thank you-

If you don't report me!

5 0
3 years ago
Which test element is used to apply test execution settings for the main business flow excluding Login and Log out 1) Run time c
Svet_ta [14]

Test element is used to apply test execution settings for the main business flow excluding Login and Log out is "Transaction  controller"

<u>Explanation:</u>

Transaction controllers are a technoscientifically kind of controllers that produce an additional sample that measures the overall time is taken or response time to perform its nested samplers.

The Controller has two checkboxes,those are

1.Generate Parent Samples

2. Include term of the timer and pre-post processors in the produced sample - It is the time which involves all processing samples within the Transaction controller, not just the HTTP samples. In Case one sample is lost or crashed then the entire Transaction Controller will fail. In case anyone sample assertion is failed then the complete Transaction Controller will fail.

3 0
4 years ago
Steam at 1400 kPa and 350°C [state 1] enters a turbine through a pipe that is 8 cm in diameter, at a mass flow rate of 0.1 kg⋅s−
sergeinik [125]

Answer:

Power output, P_{out} = 178.56 kW

Given:

Pressure of steam, P = 1400 kPa

Temperature of steam, T = 350^{\circ}C

Diameter of pipe, d = 8 cm = 0.08 m

Mass flow rate, \dot{m} = 0.1 kg.s^{- 1}

Diameter of exhaust pipe, d_{h} = 15 cm = 0.15 m

Pressure at exhaust, P' = 50 kPa

temperature, T' =  100^{\circ}C

Solution:

Now, calculation of the velocity of fluid at state 1 inlet:

\dot{m} = \frac{Av_{i}}{V_{1}}

0.1 = \frac{\frac{\pi d^{2}}{4}v_{i}}{0.2004}

0.1 = \frac{\frac{\pi 0.08^{2}}{4}v_{i}}{0.2004}

v_{i} = 3.986 m/s

Now, eqn for compressible fluid:

\rho_{1}v_{i}A_{1} = \rho_{2}v_{e}A_{2}

Now,

\frac{A_{1}v_{i}}{V_{1}} = \frac{A_{2}v_{e}}{V_{2}}

\frac{\frac{\pi d_{i}^{2}}{4}v_{i}}{V_{1}} = \frac{\frac{\pi d_{e}^{2}}{4}v_{e}}{V_{2}}

\frac{\frac{\pi \times 0.08^{2}}{4}\times 3.986}{0.2004} = \frac{\frac{\pi 0.15^{2}}{4}v_{e}}{3.418}

v_{e} = 19.33 m/s

Now, the power output can be calculated from the energy balance eqn:

P_{out} = -\dot{m}W_{s}

P_{out} = -\dot{m}(H_{2} - H_{1}) + \frac{v_{e}^{2} - v_{i}^{2}}{2}

P_{out} = - 0.1(3.4181 - 0.2004) + \frac{19.33^{2} - 3.986^{2}}{2} = 178.56 kW

4 0
3 years ago
Technician A says a sway bar is used to control body lean when cornering.
vodka [1.7K]

Answer:

technician B

Explanation:

because adding leaves increasing capacity

6 0
3 years ago
Other questions:
  • Ammonia gas is diffusing at a constant rate through a layer of stagnant air 1 mm thick. Conditions are such that the gas contain
    14·1 answer
  • A water jet that leaves a nozzle at 95 m/s at a flow rate of 120 kg/s is to be used to generate power by striking the buckets lo
    14·1 answer
  • Represent edges that cannot be seen
    14·1 answer
  • Clothing made of several thin layers of fabric with trapped air in between, often called ski clothing, is commonly used in cold
    15·1 answer
  • A stationary conductive loop with an internal resistance of 0.5 Ω is placed in a time varying magnetic field. When the loop is c
    11·1 answer
  • A car accelerates from O to 60. miles per hour in 5.2 seconds. Calculate acceleration in m/s seconds. Calculate acceleration in
    15·1 answer
  • What is the specific volume of oxygen at 40 psia and 80°F?
    10·1 answer
  • What does CADCAM stand for ?
    10·2 answers
  • A guy named Kirby Had touched only a gear on the projector. Yet there was a out of the blue rip. Kirby did not mind at all and s
    6·1 answer
  • Please. my brain isn’t working right now
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!