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
Which of the following can not be used to store an electrical charge?
Nataly_w [17]
I’ve been feeeling very lonely
3 0
3 years ago
Source 1 can supply energy at the rate of 11000 kJ/min at 310°C. A second Source 2 can supply energy at the rate of 110000 kJ/mi
VladimirAG [237]

Answer:

Source 2.

Explanation:

The efficiency of the ideal reversible heat engine is given by the Carnot's power cycle:

\eta_{th} = 1 - \frac{T_{L}}{T_{H}}

Where:

T_{L} - Temperature of the cold reservoir, in K.

T_{H} - Temperature of the hot reservoir, in K.

The thermal efficiencies are, respectively:

Source 1

\eta_{th} = 1 - \frac{311.15\,K}{583.15\,K}

\eta_{th} = 0.466 \,(46.6\,\%)

Source 2

\eta_{th} = 1 - \frac{311.15\,K}{338.15\,K}

\eta_{th} = 0.0798 \,(7.98\,\%)

The power produced by each device is presented below:

Source 1

\dot W = (0.466)\cdot (11000\,\frac{kJ}{min})\cdot (\frac{1\,min}{60\,s} )

\dot W = 85.433\,kW

Source 2

\dot W = (0.0798)\cdot (110000\,\frac{kJ}{min})\cdot (\frac{1\,min}{60\,s} )

\dot W = 146.3\,kW

The source 2 produces the largest amount of power.

8 0
3 years ago
The rectangular frame is composed of four perimeter two-force members and two cables AC and BD which are incapable of supporting
Rama09 [41]

Answer:

Your question is lacking some information attached is the missing part and the solution

A) AB = AD = BD = 0, BC = LC

    AC = \frac{5L}{3}T, CD = \frac{4L}{3} C

B) AB = AD = BC = BD = 0

   AC = \frac{5L}{3} T, CD = \frac{4L}{3} C

Explanation:

A) Forces in all members due to the load L in position A

assuming that BD goes slack from an inspection of Joint B

AB = 0 and BC = LC from Joint D, AD = 0 and CD = 4L/3 C

B) steps to arrive to the answer is attached below

AB = AD = BC = BD = 0

AC = \frac{5L}{3} T,  CD = \frac{4L}{3}C

7 0
4 years ago
Comparison of density values determines whether an item will float or sink in water. For each of the values below, determine the
geniusboy [140]

Answer:

a) the object floats

b) the object floats

c) the object sinks

Explanation:

when an object is less dense than in the fluid in which it is immersed, it will float due to its weight and volume characteristics, so to solve this problem we must find the mass and volume of each object in order to calculate the density and compare it with that of water

a)

volumen for a cube

V=L^3

L=1.53in=0.0388m

V=0.0388 ^3=5.8691x10^-5m^3=58.69ml

density=m/v

density=13.5g/58.69ml=0.23 g/ml

The wooden block floats  because it is less dense than water

b)

m=111mg=0.111g

density=m/v

density=0.111g/0.296ml=0.375g/ml

the metal paperclip floats   because it is less dense than water

c)

V=0.93cups=220.0271ml

m=0.88lb=399.1613g

Density=m/v

density=399.1613/220.027ml=1.8141g/ml

the apple sinks   because it is  denser than water

4 0
4 years ago
The themes around which social sciences texts are organized boost understanding by
Nadya [2.5K]

Answer:

  • <em>Facilitating an immensely focused setting where one does not get carried away </em>
  • <em>Creates an easier means to develop essays in relation to targeted themes </em>
  • <em>Developing "umbrellas" that one can create sub groups that a reader comes across </em>
  • <em>Instilling a directive path for vocabulary reading</em>
7 0
4 years ago
Other questions:
  • A heating cable is embedded in a concrete slab for snow melting. The heating cable is heated electrically with joule heating to
    9·1 answer
  • How 2 mak robut??...
    6·2 answers
  • Why does an object under forced convection reach a steady-state faster than an object subjected to free-convection?
    5·1 answer
  • A battery weighing 0.525 lb can store 30.8 kcal of electrical energy. What is the energy density of the battery in Wh per kg? Gi
    15·1 answer
  • Tin atoms are introduced into an FCC copper ,producing an alloy with a lattice parameter of 4.7589×10-8cm and a density of 8.772
    9·1 answer
  • Free brainlyest...........................​
    13·1 answer
  • Can some one help me on this?
    7·1 answer
  • Why did the dodge demon cross the road
    9·2 answers
  • At an open or uncontrolled intersection, yield if _____.<br> Need Help
    13·1 answer
  • Flip-flops are normally used for all of the following applications, except ________. logic gates data storage frequency division
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!