Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include "testing.h"
  4.  
  5. using namespace std;
  6.  
  7. int main(){
  8. cout << "Hello World!n";
  9. Fruits fruit_object("Apple","Red","Round");
  10. fruit_object.printfruit();
  11. }
  12.  
  13. #ifndef TESTING_H
  14. #define TESTING_H
  15. #include <string>
  16.  
  17. using namespace std;
  18.  
  19.  
  20. class Fruits{
  21. public:
  22. Fruits(string fname,string fcolor,string fshape);
  23. void printfruit();
  24. private:
  25. string Name ;
  26. string Color;
  27. string Shape;
  28. };
  29.  
  30. #endif
  31.  
  32. #include <iostream>
  33. #include <string>
  34. #include "testing.h"
  35.  
  36. using namespace std;
  37.  
  38.  
  39. Fruits::Fruits(string fname,string fcolor,string fshape){
  40. Name = fname;
  41. Color = fcolor;
  42. Shape = fshape;
  43. }
  44.  
  45. void Fruits::printfruit(){
  46. cout << Name << endl;
  47. cout << Color << endl;
  48. cout << Shape << endl;
  49. }
  50.  
  51. #include <iostream>
  52. #include <string>
  53. #include "testing.h"
  54.  
  55. using namespace std;
  56.  
  57. int main()
  58. {
  59. cout << "Hello World!n";
  60. Fruits fruit_object("Apple","Red","Round");
  61. fruit_object.printfruit();
  62. }
  63.  
  64. #ifndef TESTING_H
  65. #define TESTING_H
  66. #include <string>
  67.  
  68. using namespace std;
  69.  
  70.  
  71. class Fruits{
  72. public:
  73. Fruits(string fname,string fcolor,string fshape){
  74. Name = fname;
  75. Color = fcolor;
  76. Shape = fshape;
  77. };
  78. void printfruit(){
  79. cout << Name << endl;
  80. cout << Color << endl;
  81. cout << Shape << endl;
  82. };
  83. private:
  84. string Name ;
  85. string Color;
  86. string Shape;
  87. };
  88.  
  89. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement