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]
3 years ago
8

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

Computers and Technology
1 answer:
galben [10]3 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
20<br>Calculate the kinette energy of a body the speed<br>that will be a mass tragm​
jolli1 [7]

Answer:

20

Explanation:

4 0
3 years ago
A.)navigate
Vaselesa [24]

Answer:

start with what you know

Explanation:

you can learn a lot from it

7 0
3 years ago
In two to three sentences, describe how you would move a file.
Nina [5.8K]
<span />


You can move the file one of two ways. Your first option is to click and drag the file to another folder in the Folders pane on the left side of the window. Your second option is to right-click the file and choose Send To. Then choose from the options shown in the submenu that appears.



3 0
3 years ago
Read 2 more answers
Whats the keyboard command that will allow you to copy text ?
mamaluj [8]

its ctrl c and to paste is ctrl v

8 0
3 years ago
Read 2 more answers
This diagram shows some peripheral devices for a computer: which of the following is true
CaHeK987 [17]

Where is the diagram and answers?

4 0
3 years ago
Other questions:
  • Command icons under the following file tab in its function
    14·1 answer
  • A(n)_______ is malware that arrives in a trojan, disguised as legitimate software, and then sets up a(n) that provides unauthori
    15·1 answer
  • How does form get its power natural gas
    14·1 answer
  • ANYONE WITH K12 OHVA HIGH SCHOOL LAPTOP! I successfully enter my schools homepage and can login. BUT once I am logged in, it say
    9·2 answers
  • What is the mest gun in pixel gun 3d imma give you brainliest
    14·2 answers
  • How can i underline a simple text on word?
    9·2 answers
  • Which statement correctly differentiates how to use list and table styles?
    12·2 answers
  • What are the fundamental activities that are common to all software processes?
    9·1 answer
  • Print numbers 0, 1, 2, ..., userNum as shown, with each number indented by that number of spaces. For each printed line, print t
    8·1 answer
  • give the tightest asymptotic bounds you can for the following recurrences and provide a short explanation for your solution. you
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!