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
Brilliant_brown [7]
2 years ago
8

Provide the definition for each of the following structures and unions:

Computers and Technology
1 answer:
galben [10]2 years ago
8 0

Answer:

a)

struct inventory  // structure inventory

{

char partName[ 30 ];  // char array

int partNumber;  // variable partNumber

float price;  // FLOAT VARIABLE PRICE

int stock ;  // INT VARIABLE STOCK

int reorder;  // INTEGER VARIABLE RECORDER

};

b)

union data // structure union

{

char c;  // char variable

short s; // short variable

long b; //

long variable float f ;  // float variable

double d ; // double variable

};

c)

struct address  // structure address

{

char streetAddress[ 25 ]; // character array

char city[ 20 ]; // variable char

char  state[ 3 ] ; // state array

char  zipCode[ 6 ] ; // zipcode array

};

d)

structure student  // structure student

{

char firstName[ 15 ]; // array first name

char  lastName[ 15 ] ;  // array last name

struct address * ;  // holding the home address

};

e)

struct test

{

unsigned a:1, b:1, c:1, d:1, e:1, f:1, g:1, h:1, i:1, j:1, k:1, l:1, m:1, n:1, o:1, p:1;

}; // prototype test assign value

Explanation:

Following are the description of the above part

a)

  • By using the struct keyword we declared the structure .In the part (a) we declared the struct  "inventory".In this structure we char array "partName " of size 30 .
  • We holding the 3 int variable "partNumber" , "stock" and "reorder." and 1 float variable i.e "price ".

b)

  • By using the union keyword we declared the union .In the part (b) we created the union .
  • Inside that union we holding different types of datatype that are mention in the question .

C)

  • By using the struct keyword we declared the structure  .In the part (c) we created the structure.
  • Inside that structure we holding array of character of variable "streetAddress","city","state" and "zipcode" by using char array .

d)

  • By using the struct keyword we declared the structure .
  • In this we declared array of "firstname" and "lastname" of char datatype .
  • In the last we create a structure address by using the pointer following by struct address

e)

In the part e we created the test that contain unsigned value of thhe 16 bit and 1 width

You might be interested in
What's the main idea??
tatyana61 [14]
My computer wont let me download this pdf

7 0
2 years ago
What is output?
postnew [5]

Answer:The French and Dutch settlements differed from the Spanish colonies in that they were created mainly to trade and develop industries, while the Spanish were primarily concerned with gold and silver excavation, and then later with sugar exportation.

Explanation:The French and Dutch settlements differed from the Spanish colonies in that they were created mainly to trade and develop industries, while the Spanish were primarily concerned with gold and silver excavation, and then later with sugar exportation.

8 0
3 years ago
How can people efficiently and effectively influence lots of people throughout the world
tatuchka [14]

Answer:

The word efficient denotes the ability to achieve a good goal toward a person, and effectiveness denotes reliable production or achievement.

Explanation:

Many people around the world can set efficient goals, that is, to influence or encourage other people to make good projects or changes in their lives, by example or simply teach them with patience and altruism.

In this way effectiveness will be seen, that is, the product or the achievement precisely when we observe how people undertake new projects in their lives

3 0
3 years ago
When an object reflects all the light which falls on it it's color will be
lara31 [8.8K]
A- White. shows all wavelengths of light.
4 0
3 years ago
Read 2 more answers
Decribe the components of an Microsoft<br>Windows desktop<br>​
damaskus [11]

Explanation:

the main component of Windows when you start your computer are the desktop, my computer, recycle bin , start button, Taskbar and shortcuts to application after opening an application you will also have a Windows with an active application which will appear in your desktop and taskbar.

3 0
3 years ago
Other questions:
  • which of the following is true about both the cyber community and the real community like the one you live in,i will give 10 poi
    6·1 answer
  • Write an expression that will cause the following code to print "Equal" if the value of sensorReading is "close enough" to targe
    9·1 answer
  • What is the difference between a manufacturing engineer and a materials engineer?
    7·2 answers
  • What is the meaning of the word joystick
    6·2 answers
  • Has anyone on here heard from lilkoadkmillines?
    10·1 answer
  • Citing Wikipedia as a reference is not considered a good practice because 1.leverages a neutral point of view. 2.hosts unopinion
    8·1 answer
  • A software update is also referred to as what?
    15·2 answers
  • What are the reasonsfor documenting business rules​
    6·1 answer
  • If you wanted a smartphone with the fewest restrictions on application development which smartphone operating system should you
    9·1 answer
  • This might sound crazy! But please help.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!