fork(1) download
  1.  
  2. #include <iostream>
  3. //#include <stdio.h>
  4. #include <string.h>
  5.  
  6. using namespace std;
  7.  
  8. /* add supporting structures */
  9. struct date
  10. {
  11. int month;
  12. int day;
  13. int year;
  14. };
  15.  
  16. struct name
  17. {
  18. char firstName[25];
  19. char middleInitial;
  20. char lastName[40];
  21. };
  22.  
  23. struct address
  24. {
  25. char street1[25]; /* first line of street address */
  26. char street2[25]; /* second line, optional */
  27. char city[25]; /* name of city */
  28. char state[3]; /* 2-letter state abreviation */
  29. char zip[6]; /* 5-digit ZIP code */
  30. char plusFour[5]; /* 4-digit ZIP code extension */
  31. };
  32.  
  33. struct height
  34. {
  35. int feet;
  36. int inches;
  37. };
  38.  
  39. /* the actual license structure that will contain all needed members */
  40. class license
  41. {
  42. private:
  43. string number; /* alpha numeric license number */
  44. struct date birthDate; /* the date the driver was born */
  45. struct name driverName; /* full name of driver */
  46. struct date issueDate; /* date the license was issued */
  47. struct date expirationDate; /* date the license will expire */
  48. string endorsements; /* list of 1 or more letters or "NONE" */
  49. char vehicleClass; /* single letter for class of vehicle (D=small vehicle) */
  50. string restrictions; /* list of 1 or more letters (B=corrective lenses) or "NONE" */
  51. char sex; /* single letter (M=male, F=female) */
  52. struct height driverHeight; /* driver's height in feet and inches */
  53. struct address driverAddress; /* driver's address */
  54.  
  55. public:
  56. // empty constructor
  57. license();
  58.  
  59. // initializing constructor
  60. license(string aNumber, date aBirthDate, name aDriverName, date anIssueDate,
  61. date anExpirationDate, string anEndorsements, char aVehicleClass,
  62. string aRestrictions, char aSex, height aDriverHeight, address aDriverAddress);
  63. };
  64.  
  65. // The license class member definitions follow:
  66. license::license ()
  67. {
  68.  
  69. }
  70.  
  71. // initializing constructor
  72. license::license(string aNumber, date aBirthDate, name aDriverName, date anIssueDate,
  73. date anExpirationDate, string anEndorsements, char aVehicleClass,
  74. string aRestrictions, char aSex, height aDriverHeight, address aDriverAddress)
  75. {
  76. number = aNumber;
  77. birthDate = aBirthDate;
  78. driverName = aDriverName;
  79. issueDate = anIssueDate;
  80. expirationDate = anExpirationDate;
  81. endorsements = anEndorsements;
  82. vehicleClass = aVehicleClass;
  83. restrictions = aRestrictions;
  84. sex = aSex;
  85. driverHeight = aDriverHeight;
  86. driverAddress = aDriverAddress;
  87. }
  88.  
  89. int main()
  90. {
  91. return 0;
  92. }
  93.  
Success #stdin #stdout 0.01s 2720KB
stdin
Standard input is empty
stdout
Standard output is empty