Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include "testing.h"
- using namespace std;
- int main(){
- cout << "Hello World!n";
- Fruits fruit_object("Apple","Red","Round");
- fruit_object.printfruit();
- }
- #ifndef TESTING_H
- #define TESTING_H
- #include <string>
- using namespace std;
- class Fruits{
- public:
- Fruits(string fname,string fcolor,string fshape);
- void printfruit();
- private:
- string Name ;
- string Color;
- string Shape;
- };
- #endif
- #include <iostream>
- #include <string>
- #include "testing.h"
- using namespace std;
- Fruits::Fruits(string fname,string fcolor,string fshape){
- Name = fname;
- Color = fcolor;
- Shape = fshape;
- }
- void Fruits::printfruit(){
- cout << Name << endl;
- cout << Color << endl;
- cout << Shape << endl;
- }
- #include <iostream>
- #include <string>
- #include "testing.h"
- using namespace std;
- int main()
- {
- cout << "Hello World!n";
- Fruits fruit_object("Apple","Red","Round");
- fruit_object.printfruit();
- }
- #ifndef TESTING_H
- #define TESTING_H
- #include <string>
- using namespace std;
- class Fruits{
- public:
- Fruits(string fname,string fcolor,string fshape){
- Name = fname;
- Color = fcolor;
- Shape = fshape;
- };
- void printfruit(){
- cout << Name << endl;
- cout << Color << endl;
- cout << Shape << endl;
- };
- private:
- string Name ;
- string Color;
- string Shape;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement