Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
534 B
0
Indexable
Never
#include <iostream>
#include <vector>
class kiberniger {
	std::string name;
	std::vector <int> marki;
	int classn = 12;
public:
	void setName(std::string n) {
		name = n;
	};
	void addMark(int n) {
		marki.push_back(n);
	};
	float getMiddleMark() {
		float j = 0;
		for (int i : marki) {
			j += i;
		}
		return j / float(marki.size());
	};
	
};
int main() {
	kiberniger felix;
	felix.setName("Fufelshmerts");
	felix.addMark(5);
	felix.addMark(4);
	felix.addMark(4);
	std::cout << felix.getMiddleMark();
}