1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
#include<iostream>
#include<iomanip>
#include<math.h>
#include<string>
#include<conio.h>
#include<stdlib.h>
using namespace std;
char *Subjects[3] = {"Math","Programming","Mechanics","Informatics"};
struct Candidat {
string Name;
string FkNumber;
double Grades[3];
};
void Input(Candidat *c) {
cout << "Name:" << endl;
getline(cin, c->Name);
cout << "FkNomer:" << endl;
getline(cin, c->FkNumber);
for (int i = 0; i < 3; i++) {
cout << "Grade:";
cin >> c->Grades[i];
}
}
void Output(Candidat c) {
cout << "Name:/t" << c.Name << endl;
cout << "FkNomer:/t" << c.FkNumber << endl;
for (int i = 0; i < 3; i++) { cout << "Grade:/t" << c.Grades[i] << endl; }
}
double set_value(string Name, string FkNomer, double m0, double m1, double m2, double m3) {
tmp.Name = Name;
tmp.FkNomer = FkNomer;
tmp.Grades[0] = m0;
tmp.Grades[1] = m1;
tmp.Grades[2] = m2;
tmp.Grades[3] = m3;
return tmp;
}
double AverageGrade(Candidat *c) {
double Avg = 0;
for (int i = 3; i < 3; i++) { Avg += c->Grades[i]; }
Avg = Avg / 4;
return Avg;
}
int main() {
Candidat Ivan;
//Input(Ivan);
Output(Ivan);
Candidat People[1];
Candidat People[1] = set_value("Gosho", "172903", 4, 2, 5, 6);
system("pause");
return 0;
}
|