Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //punct.h
- #ifndef L2P1_H
- #define L2P1_H
- #include "l2p1.h"
- #include <iostream>
- #include <conio.h>
- using namespace std;
- class Punct
- {
- double x,y;
- public:
- void setX();
- void setY();
- double getX();
- double getY();
- void afis();
- };
- #endif;
- //punct.cpp
- #include "l2p1.h"
- #include "l2p1.h"
- void Punct::setX()
- {
- cout<<"x=";
- cin>>x;
- cout<<endl;
- }
- void Punct::setY()
- {
- cout<<"y=";
- cin>>y;
- cout<<endl;
- }
- double Punct::getX()
- {
- return x;
- }
- double Punct::getY()
- {
- return y;
- }
- void Punct::afis()
- {
- cout<<"x="<<x<<' '<<"y="<<y<<endl;
- }
- //main.cpp
- #include "l2p1.h"
- int main()
- {
- Punct a,b,c;
- a.setX();
- a.setY();
- a.getX();
- a.getY();
- a.afis();
- b.setX();
- b.setY();
- b.getX();
- b.getY();
- b.afis();
- c.setX();
- c.setY();
- c.getX();
- c.getY();
- c.afis();
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement