consolidate all repos to one for archive
This commit is contained in:
20
semester_2/programiranje_2/primeri/Example01/Point.cpp
Normal file
20
semester_2/programiranje_2/primeri/Example01/Point.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <iostream>
|
||||
#include "Point.h"
|
||||
|
||||
int Point::getX() {
|
||||
return x;
|
||||
}
|
||||
int Point::getY() {
|
||||
return y;
|
||||
}
|
||||
//void Point::setX(int xx) {
|
||||
void Point::setX(int x) {
|
||||
//x=xx;
|
||||
this->x=x;
|
||||
}
|
||||
void Point::setY(int y) {
|
||||
this->y=y;
|
||||
}
|
||||
void Point::print() {
|
||||
std::cout << "(" << x << "," << y << ")" << std::endl;
|
||||
}
|
17
semester_2/programiranje_2/primeri/Example01/Point.h
Normal file
17
semester_2/programiranje_2/primeri/Example01/Point.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef EXAMPLE01_POINT_H
|
||||
#define EXAMPLE01_POINT_H
|
||||
|
||||
class Point {
|
||||
private:
|
||||
int x, y;
|
||||
public:
|
||||
int getX();
|
||||
int getY();
|
||||
void setX(int x);
|
||||
void setY(int y);
|
||||
void print();
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif //EXAMPLE01_POINT_H
|
20
semester_2/programiranje_2/primeri/Example01/main.cpp
Normal file
20
semester_2/programiranje_2/primeri/Example01/main.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <iostream>
|
||||
#include "Point.h"
|
||||
|
||||
int main() {
|
||||
Point a;
|
||||
Point b;
|
||||
//Point b(a);
|
||||
/**/
|
||||
a.setX(3);
|
||||
a.setY(2);
|
||||
b.setX(1);
|
||||
b.setY(1);
|
||||
|
||||
std::cout << a.getX() << std::endl;
|
||||
std::cout << a.getY() << std::endl;
|
||||
//b.x=10;
|
||||
a.print();
|
||||
b.print();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user