CS 240 Dietel & Dietel [2000] Quiz #1 Preprocessor & Structures Fall 2000 Please, open this document in MS Word and type the answers in the space after each question. All code should be in C++. Please space legibly. Save often in case of power-outage. Best wishes!! Please type name here: _______________________________ 1.a. The Sarah Byrd Askew library has just hired you as chief programmer for their collection. Write a struct statement to define a structure data-type (called book) which will store a library card catalog entry for a book, including: author, title, publishing company, year of publication, ISBN number, Library of Congress number, dewey-decimal entry. 1.b. Creat an array (called shelf) of 100,000 of those book struct's. 1.c. For the array in 1.b. (above), write all assignment statements needed to fully set the 200th book in the shelf to the Dietel & Dietel book (including all fields). 1.d. Write the prototype and function call which will call a routine called sort which will sort this array and return it to the main program. Do not write the whole function. Be careful and meticulous. prototype: function call: 2.a. Write a struct (called point) which will define a point in the Cartesian plane. 2.b. Write a struct which will store a triangle (call it tri) using only the data-types from part 2.a. (above) 2.c. Write the code needed to creat a variable (called bermuda) of type tri, allocating memory for an actual triangle. 2.d. Write a macro dist(x1,y1,x2,y2) which will compute the distance between two points. 2.e. Write the 4 lines of code which uses the macro in 2.d. (above) to compute the perimeter of the bermuda triangle from 2.c. Multiple Choice: A sheet with about 25-50 multiple choice questions will be distributed. Fill in answers on the scantrons. Weight = 50%(Long Answer) + 50%(Multiple Choice)