Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. class ypalilos{
  6.     private:
  7.         string name;
  8.         float misthos; 
  9.            
  10.     public:    
  11.         ypalilos(){
  12.             name="";
  13.             misthos=0;
  14.         }
  15.        
  16.         void setValues(string n, float m){
  17.             name =n;
  18.             misthos = m;
  19.         }  
  20. };
  21.  
  22. int main(){
  23.     ypalilos yp1;
  24.     string n;
  25.     float m;
  26.     cout<<"Dwse to onoma tou ypalilou."<<endl;
  27.     cin>>n;
  28.     cout<<"Dwse ton mistho tou ypalilou."<<endl;
  29.     cin>>m;
  30.     yp1.setValues(n,m);
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement