Guest User

Untitled

a guest
Oct 1st, 2011
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.34 KB | None | 0 0
  1. /*
  2. Create a class "Skirt" which has variables for model name, material name, lenght and width of the material and percentage of the remnant. The sewing fabric sews 3 different models of skirts. Find out which one of these 3 models needs the biggest quantity of the material and which one has the smallest percentage of the remnant left.
  3. */
  4.  
  5. #include <iostream>  
  6. using namespace std;  
  7. #include <string>
  8. //----------------------------------------------------
  9. class Skirt
  10. {
  11. private:
  12.   int modelname, materialname, length, width, patternpercentage;
  13. public:
  14.   Skirt() {}
  15.   ~Skirt(){}
  16.   Skirt(int modelnameValue, int materialnameValue, int lengthValue, int widthValue, int remnantpercentageValue);
  17.   int TakeModelname();
  18.   int TakeMaterialname();
  19.   int TakeLength();
  20.   int TakeWidth();
  21.   int TakeRemnantpercentage();
  22. };
  23. //----------------------------------------------------
  24. int main()
  25. {
  26. cout << "Sewing Fabric\n";
  27.  
  28.   int modelname, materialname, length, width, remnantpercentage;
  29.  
  30.   cout << "Write model name: " << endl;
  31.   cin >> modelname >> endl;
  32.   cout << "Write material name: " << endl;
  33.   cin >> materialname >> endl;
  34.   cout << "Write the length of the material: " << endl;
  35.   cin >> length >> endl;
  36.   cout << "Write the width of the material: " << endl;
  37.   cin >> width >> endl;
  38.   cout << "Write the percentage of the remnant: " << endl;
  39.   cin >> remnantpercentage >> endl;
  40.  
  41.  
  42.   return 0;
  43. }
  44. // ---------------------------------------------------
  45. Skirt::Skirt(int modelnameValue, int materialnameValue, int lengthValue, int widthValue, int remnantpercentageValue) :
  46.              modelname(modelnameValue), materialname(materialnameValue), length(lengthValue), width(widthValue), remnantpercentage(remnantpercentageValue)
  47. { }
  48. // ---------------------------------------------------
  49. int Skirt::TakeModelname()
  50. {
  51.   return modelname;
  52. }
  53. // ---------------------------------------------------
  54. int Skirt::TakeMaterialname()
  55. {
  56.   return materialname;
  57. }
  58. // ---------------------------------------------------
  59. int Skirt::TakeLength()
  60. {
  61.   return length;
  62. }
  63. //----------------------------------------------------
  64. int Skirt::TakeWidth()
  65. {
  66.   return width;
  67. }
  68. //----------------------------------------------------
  69. int Skirt::TakeRemnantpercentage()
  70. {
  71.   return remnantpercentage;
  72. }
  73. //----------------------------------------------------
  74.  
  75.  
  76.  
Advertisement
Add Comment
Please, Sign In to add comment