All of the work in this project is my own!  I have not left copies of my code in public folders on university computers. I have not given any of this project to others. I will not give any portion of this project to others taking this class. I realize that the penalty for turning in work that is not my own can range from an "F" in the class to dismissal from Trinity University. 

                                    Print Title  ______________________________________    Time Required = ______.____ Hrs.

                                    Signature   ______________________________________    (pledged)


Structure Part Lab
Individual Homework Assignment
25 Points

Utility-Tom-Hicks.h
Tom-Hicks-HW-10.c

1] Include your utility file Utility-Tom-Hicks.h (use your first and last name)

2] Add function GetDouble to your utility collection; make a copy of GetFloat and modify it.

2] Create a structure called Part.

//bool GetString(char Prompt[], char String[], long int MaxChar, bool Clear);
//bool GetInt (char Prompt[], int * Int, int Low, int High, bool Clear);
//bool GetFloat (char Prompt[], float * Float, float Low, float High, bool Clear);
//bool GetDouble (char Prompt[], double * Double, double Low, double High, bool Clear);

//--------------------------------------------------------------------
//                            Prototypes
//--------------------------------------------------------------------
void DisplayPart(struct Part P, char Message[]);
void InitializePart(struct Part * P);
void GetPart(struct Part * P);|
void SetPart(struct Part * P, char NewName[], char NewDescription[], char NewInternalNotes[],
             char NewImageName[],int NewID, double NewBarCode, int NewSupplierID, 
             int NewDeptNo, float NewWholeSaleCost, float NewRetailPrice, 
             float NewLowestSalePrice, int NewQtyInStock, int NewMinQtyToStock,
             int NewQtySoldThisQuarter, float NewPackageVolume, float NewPackageWeight,
             float NewPackageHeight, float NewPackageWidth, float NewPackageDepth);

3] Create Function DisplayPart.  Display the message and the data as illustrated below.

Current Basketball Record:
-----------------------------------------------
Name..........................:
Spalding Basketball
ID#...........................:
1121
Description...................:
NBA Quality Spalding Leather Basketball
Internal Notes................:
Really Fine Ball For Indoor Usage Only
Image Name....................:
SpaldingLeatherBasketball.jpg

Bar Code......................: 112233445566
Supplier  ID..................:
2
Dept. No......................:
5

Retail Price..................:$
54.99
Wholesale Cost................:$
23.12
Lowest Sale Price.............:$
39.99

Quantity In Stock.............:
17
Minimum Quantity To Stock.....:
25
Quantity Sold This Quarter....:
112

Package Volume................: 27000 cu in
Package Weight................:
13.0 oz
Package Height................:
9.0 in
Package Width.................:
9.0 in
Package Depth.................: 9.0 in
-----------------------------------------------

3] Create Function InitializePart. It is to reset all character data to blanks and all numeric data to 0's.

4] Create Function Get Part. It is to prompt the user for Part information in somewhat the following format:
You are going to have [Hit ENTER Key To Exit] in there as well, but line things up similar to the following:
Use GetInt, GetFloat, GetDouble, and GetString functions.

-----------------------------------------------
Enter Name..........................:
Spalding Basketball
Enter ID#...........................:
1121
Enter Description...................:
NBA Quality Spalding Leather Basketball
Enter Internal Notes................:
Really Fine Ball For Indoor Usage Only
Enter Image Name....................:
SpaldingLeatherBasketball.jpg

Enter Bar Code......................: 112233445566
Enter Supplier  ID..................:
2
Enter Dept. No......................:
5

Enter Retail Price..................:$
54.99
Enter Wholesale Cost................:$
23.12
Enter Lowest Sale Price.............:$
39.99

Enter Quantity In Stock.............:
17
Enter Minimum Quantity To Stock.....:
25
Enter Quantity Sold This Quarter....:
112

Enter Package Volume................: 27000 cu in
Enter Package Weight................:
13.0 oz
Enter Package Height................:
9.0 in
Enter Package Width.................:
9.0 in
Enter Package Depth.................: 9.0 in
-----------------------------------------------

5] Function SetPart will fill the Part with the new data passed. Include the following function call in your program:

     SetPart(&Basketball, "Spalding Basketball", "NBA Quality Spalding Leather Basketball", 
             "Really Fine Ball For Indoor Usage Only","SpaldingLeatherBasketball.jpg"
             1121, 112233445566, 2, 5, 23.12, 54.99, 39.99, 17, 25, 112, 27000,
             13.0, 9.0, 9.0, 9.0);

6] Program Main:
Your main program is to declare two Part type variables called
Basketball and Football.

For each of these two parts, you are to

  1. call initialize

  2. call display

  3. call get

  4. call display

  5. call Set

  6. call display


Copy Files

 
1] Copy file Tom-HW10.c  to /users/thicks/hw1320/hw10

2] Copy file  Utility-Tom-Hicks.h  to /users/thicks/hw1320/hw10
 


What To Turn In

1] Signed copy of page 1 of this Lab.

2] Printed copy of both files

3] Nothing will be graded until you copy the file into the /users/thicks/hw1320 directory.

4] Nothing will be graded until this lab form is submitted.  Staple the pages. Fold the lab Horizontally (like a hot dog) and write your name nice and large on the outside.  Place it on the professor desk before the beginning of lecture on the day it is due. All assignments are due the next class period unless otherwise designated on the schedule page.