geekbrains_oop_cpp/lesson_2/main.cpp

49 lines
1.3 KiB
C++
Raw Normal View History

2021-06-20 19:46:32 +00:00
#include <iostream>
2021-06-21 07:54:54 +00:00
#include <vector>
2021-06-20 19:46:32 +00:00
#include "exercise_1.hpp"
2021-06-21 11:22:07 +00:00
#include "exercise_2.hpp"
2021-06-20 19:46:32 +00:00
using namespace std;
int Student::count = 0;
int main()
{
2021-06-21 07:54:54 +00:00
// Student students[] =
// {
// Student("Олег", 20, GENDER_MALE, 75.2, 2020),
// Student("Андрей", 19, GENDER_MALE, 72.8, 2020),
// Student("Анастасия", 20, GENDER_FEMALE, 55.2, 2020),
// Student("Ольга", 21, GENDER_FEMALE, 49.3, 2020),
// Student("Владимир", 19, GENDER_MALE, 69.9, 2020)
// };
//
// Student::printCount();
//
// students[0].printInfo();
// students[2].printInfo();
2021-06-21 11:22:07 +00:00
// vector<Student> students;
//
// students.emplace_back("Олег", 20, GENDER_MALE, 75.2, 2020);
// students.emplace_back("Андрей", 19, GENDER_MALE, 72.8, 2020);
// students.emplace_back("Анастасия", 20, GENDER_FEMALE, 55.2, 2020);
// students.emplace_back("Ольга", 21, GENDER_FEMALE, 49.3, 2020);
// students.emplace_back("Владимир", 19, GENDER_MALE, 69.9, 2020);
//
// Student::printCount();
// Exercise 2
2021-06-21 07:54:54 +00:00
2021-06-21 11:22:07 +00:00
Apple a("red");
Banana b;
GrannySmith c;
2021-06-21 07:54:54 +00:00
2021-06-21 11:22:07 +00:00
std::cout << "My " << a.getName() << " is " << a.getColor() << ".\n";
std::cout << "My " << b.getName() << " is " << b.getColor() << ".\n";
std::cout << "My " << c.getName() << " is " << c.getColor() << ".\n";
2021-06-20 19:46:32 +00:00
return 0;
}