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
Write a recursive Scheme function merge(firstNameList, lastNamelist) that receives a simple list of first names and a simple lis
miv72 [106K]

Answer:

Write a recursive Scheme function power(A, B) that takes two integer parameters, A and B, and returns A raised to the B power. A must be a positive value, but B maybe a negative value.

Explanation:

7 0
3 years ago
Write a program that allow a customer to input the value of goods bought, The program should then decide the discount to give a
Thepotemich [5.8K]

Answer:

geeksforgeeks is the answer

5 0
2 years ago
Megan was employed by a large company. Her supervisor told her to falsify government reports. She refused and was fired. She sue
Ber [7]

Answer: Option(d) is correct option

Explanation:

At-will employment is the employment in contractual manner in which employer can fire employee without any warning or indication .They can fire employee for any cause .

  • According to the question, even though Megan was hired at at-will employment base ,she does not persist much right over the company but she should not be dismissed for not performing illegal act as the reason for getting fired.This is a unfair and illegal manner of firing.
  • Other options are incorrect because employer was not correct on firing her because of loyalty duty or based on legal right or with just reason.Thus, the correct option is option(d)
7 0
3 years ago
A software developer would utilize a(n) ________ to detail a compilation of hardware and software components to create a framewo
sweet [91]

A software developer would utilize an architectural design to detail a compilation of hardware and software components to create a framework for software development.

The term architectural design denotes the oftware architecture while the term non-architectural design denotes the detailed design. The architect draws the line between these two designs.

6 0
3 years ago
children 4 to 5 years old are required by law to be secured in a federally approved separate booster for integrated child seat.
Nezavi [6.7K]

Answer:

Its true.

Explanation:

Children under 6 years should be secured in a child seat.

3 0
3 years ago
Read 2 more answers
Other questions:
  • Most students overestimate their skill level and abilities to take open book tests.
    11·2 answers
  • Steven is in a meeting and he is sharing a graph on his monitor with fifty other people. So that the others do not need to crowd
    9·1 answer
  • Discuss the different types of user-friendly interfaces and the types of users who typically use each.
    12·1 answer
  • How has music changed with the use of technology?
    14·1 answer
  • The
    6·1 answer
  • Management information system by different outhors<br>​
    10·1 answer
  • Help fast fast anyone
    10·1 answer
  • Ví dụ sau sẽ in ra dữ liệu của x là kiểu gì ?
    9·1 answer
  • What does mean in computer science
    10·1 answer
  • Which unit of binary storage has a size that is processor dependent?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!