#include #include int main() { /* The ID list Customer ID = 25453; Company ID = 39828; Part-typeID = 43455; Part ID = 89888; */ /* the pointer to the file "part.dat" */ FILE *p; char TemName1[10]; char TemEmail[25]; char sp = '|'; int i,j,r1,r2,Temptid; /* The part-type ID */ int tid = 0; int tnum = 43455; /* The part ID */ int pid =0; int pnum = 89888; /* The name of the part-types */ char *tname[] = { "Brake system", "Heatsytem", "Fuel system", "Suspension system", "Transmission system", "Steering system", "Body/Chassis parts", "Engine system", "Accessories", "Exhaust system", "Electrical system", "A/C system", "Filters" }; /* parts in part types */ char *pname[] = { "brake pads" , "brake shoes" , "master cylinders" , "clutch" , "wheel cylinders" , "drums" , "rotors" , "cables" , "Coil springs" , "Dampers" , "Suspension bearings" , "Torsion bars" , "HE1" , "HE2" , "HE3" , "HE4" , "electric fuel pumps" , "injectors" , "carburetors" , "carburetor kits", "TPS sensors" , "electric chokes", "choke pull offs" , "sensors", "ball joints" , "idler arms" , "pitman arms" , "tie rods" , "tie rod assemblies" , "bushings" , "drag links" , "center links" , "Axle shafts" , "Cable wiring" , "Clutch disks" , "clutch release bearings", "Disk/Flywheels" , "differential gears" , "Drive shafts/gears" , "reducers" , "hydraulic" , "Mechanical" , "Power assisted" , "Fittings" , "Ste1" , "Ste2" , "Ste3" , "Ste4" , "Brackets" , "Bumpers" , "Dies casting parts" , "Drip moulding" , "Fenders" , "Hood" , "Doors" , "Locks" , "Water pumps" , "Fuel pumps" , "Pistons" , "engine bearings", "Camshafts" , "Gaskets" , "Lifters" , "valves" , "Ligths" , "Mirrors" , "Fog lights" , "reflectors" , "Wiper blades" , "Tools" , "Horns" , "Antennas" , "Catalytic converter" , "Muffler" , "Exhaust Chamber" , "EX1" , "Ex2" , "Ex3" , "Ex4" , "Ex5" , "Spark plugs" , "Spark plug wire sets", "Caps" , "Rotors" , "pionts" , "Condensers" , "Coils" , "Modules" , "Compressors" , "Evaporators" , "Condensers" , "Hoses" , "Clutches" , "AC1" , "AC2" , "AC3" , "Oil" , "Gas" , "Fuel" , "Deisel" , "Fil1" , "Fil2" "Fil3" , "Fil4" }; /* The information regarding each part */ char *pinf = "readcatalog"; int tseed; int pcost; p = fopen("part.dat","w"); pid = pnum; for ( i = 0 ; i < 13; i++) { tid = tnum + i; tseed = i*8 - 1; for ( j = 0; j < 8; j++) { pcost = (int)(10000.0*rand()/(RAND_MAX + 1.0)); fprintf(p,"%d %c %d %c %s %c %d %c %s \n", tid,sp,pid,sp, pname[tseed+j],sp,pcost,sp,pinf); pid++; } } return 0; }