Website Summary Files Commits Branches @commit @diff @stats
path: root / pract_SI / Pract. 10 / task1
diff options
context:
space:
mode:
3 files changed, 35 insertions, 0 deletions
-rw-r--r--pract_SI/Pract. 10/task1/Student.cpp18
-rw-r--r--pract_SI/Pract. 10/task1/Student.h17
-rw-r--r--pract_SI/Pract. 10/task1/main.cppbin0 -> 3064 bytes
diff --git a/pract_SI/Pract. 10/task1/Student.cpp b/pract_SI/Pract. 10/task1/Student.cpp
new file mode 100644
index 0000000..06cf89a
--- /dev/null
+++ b/pract_SI/Pract. 10/task1/Student.cpp
@@ -0,0 +1,18 @@
+#include "pch.h"
+#include "Student.h"
+#include <iostream>
+
+float Student::calculateFinalGrade() //среден успех за годината.
+{
+ return (GradeFirstTerm + GradeSecondTerm) / 2;
+}
+
+bool Student::checkBirthdate(unsigned _year) // роден преди определена година.
+{
+ return year < _year;
+}
+
+void Student::enterData()
+{
+ std::cin >> name >> adress >> year >> GradeFirstTerm >> GradeSecondTerm;
+} \ No newline at end of file
diff --git a/pract_SI/Pract. 10/task1/Student.h b/pract_SI/Pract. 10/task1/Student.h
new file mode 100644
index 0000000..11da143
--- /dev/null
+++ b/pract_SI/Pract. 10/task1/Student.h
@@ -0,0 +1,17 @@
+#pragma once
+#include <string>
+
+struct Student
+{
+ //variable Student
+ std::string name;
+ std::string adress;
+ unsigned year;
+ float GradeFirstTerm, GradeSecondTerm;
+
+ float calculateFinalGrade(); //среден успех за годината.
+
+ bool checkBirthdate(unsigned _year); // роден преди определена година.
+
+ void enterData();
+}; \ No newline at end of file
diff --git a/pract_SI/Pract. 10/task1/main.cpp b/pract_SI/Pract. 10/task1/main.cpp
new file mode 100644
index 0000000..0fb5841
--- /dev/null
+++ b/pract_SI/Pract. 10/task1/main.cpp
Binary files differ