Provide the definition for each of the following structures:
a) Structure Inventory, containing character array partName[ 30 ], integer partNumber, floating-point price, integer stock and integer reorder.
b) A structure called Address that contains character arrays streetAddress[ 25 ], city[
20 ], state[ 3 ] and zipCode[ 6 ].
c) Structure Student, containing arrays firstName[ 15 ] and lastName[ 15 ] and variable homeAddress of type struct Address from part (b).
d) Structure Test, containing 16 bit fields with widths of 1 bit. The names of the bit fields are the letters a to p.
a) ```
struct Inventory
{
char partName[ 30 ];
int partNumber;
double price;
int stock;
int reorder;
}; // end struct Inventory
```
b)```
struct Address
{
char streetAddress[ 25 ];
char city[ 20 ];
char state[ 3 ];
char zipCode[ 6 ];
}; // end struct Address
```
c)```
struct Student
{
char firstName[ 15 ];
char lastName[ 15 ];
struct Address homeAddress;
}; // end struct Student
```
d) ```
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;
}; // end struct Test
```
You might also like to view...
What sorting algorithm is implemented by the following function?
void sort(int arr[]) { int n = arr.length; for (int i = 0; i < n-1; i++) { int min_idx = i; for (int j = i+1; j < n; j++) if (arr[j] < arr[min_idx]) min_idx = j; int temp = arr[min_idx]; arr[min_idx] = arr[i]; arr[i] = temp; } } a. Selection sort. b. Bubble Sort. c. Quick sort. d. Merge Sort.
To restore a file from the Recycle Bin, click the file and click the Restore this item button from the ________
A) content pane B) title bar C) navigation pane D) toolbar
You must use double brackets to enclose the text you want the IF function to return in the second and third arguments.
Answer the following statement true (T) or false (F)
You can use Java's ____ class to create your own random access files.
A. Path B. FileStream C. File D. FileChannel