
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Provide the definition for each of the following structures and unions:
a) Structure inventory containing character array partName[ 30 ], integer partNumber,
floating point price, integer stock and integer reorder.
b) Union data containing char c, short s, long b, float f and double d.
c) A structure called address that contains character arrays streetAddress[ 25 ], city[ 20 ],
state[ 3 ] and zipCode[ 6 ].
Page 8 of 9
d) Structure student that contains arrays firstName[ 15 ] and lastName[ 15 ] and variable
homeAddress of type struct address from part (c).
e) Structure test containing 16 bit fields with widths of 1 bit. The names of the bit fields
are the letters a to p.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- 3. Assume you have the following structure definition: struct parts { string name; int num; float price; int qInStock; }; a. Write a program that declares an array of the parts structure, size 10, name of your choice, and includes the following: Write a void function to request user input into each of the component members of the parts structure array. Be sure to include proper user prompts. Assume the entire structure array is filled. Write the prototype and the function definition. Call the function from main.Write a void function to output the information in the parts structure array. Write the prototype and the function definition. Call the function from main.arrow_forwardc language and use int main format pleasearrow_forwardGame of Hunt in C++ language Create the 'Game of Hunt'. The computer ‘hides’ the treasure at a random location in a 10x10 matrix. The user guesses the location by entering a row and column values. The game ends when the user locates the treasure or the treasure value is less than or equal to zero. Guesses in the wrong location will provide clues such as a compass direction or number of squares horizontally or vertically to the treasure. Using the random number generator, display one of the following in the board where the player made their guess: U# Treasure is up ‘#’ on the vertical axis (where # represents an integer number). D# Treasure is down ‘#’ on the vertical axis (where # represents an integer number) || Treasure is in this row, not up or down from the guess location. -> Treasure is to the right. <- Treasure is to the left. -- Treasure is in the same column, not left or right. +$ Adds $50 to treasure and no $50 turn loss. -$ Subtracts…arrow_forward
- Program in C. You are grading your students’ exams and will create a program to help you with the process. Each exam contains 3 problems. Minimum score in each problem is 0; maximum score is 33.33. Use these steps as your guidance: Define a structure called Student. Give the structure 4 members; one ID (integer) and three scores (decimal numbers). Then, in main, ask for the number of students you will be grading. Then, create an array of structures of type Student. Then, also in main, iterate through each one of them and scan their ID and scores. Lastly, also in main, print out the ID of the student, followed by the final grade (addition of the three scores). Notes: You don’t have to check if the user inputted a score between 0 and 33.33. You may assume users will always input a score within this range. No need of functions (everything can be done in main if you want to).arrow_forwardtypedef char string[50]; struct a Tag { int a; }; // 1. indicate the data type returned by function Exam() Exam(struct a Tag *ptr) { float b; double C[ 10 ]; string s; } // Access the members of the structure variable indirectly via ptr // You are REQUIRED to use the structure pointer operator; see comments numbered 2 to 5. // 2. input the value of member a scanf("%d", ); // 3. assign 3.1416 as the value of member b = 3.1416; // 4. print the value of the last element of array C. printf("%lf\n", |); // 5. copy "Hello" into string s strcpy( return ptr; , "Hello");arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education