The teacher asked the question, in which line of this code (C ++) is static polymorphism implemented? Also, the teacher said that there exists a static polymorphism implicitly.
#include"stdafx.h" #include<iostream> #include<clocale> #include<conio.h> #include<ctime> using namespace std; class pulsometer { public: int pulse; int calories; int timer; void show_pulse(void); void show_calories(void); void show_timer() { cout << "Таймер: " << timer << endl; } void start_timer() { timer = 10; } }; void pulsometer::show_pulse(void) { pulsometer::pulse = rand() % 45 + 90; cout << "Пульс: " << pulse << endl; } void pulsometer::show_calories(void) { pulsometer::calories = rand() % 1000; cout << "Сожжено: " << calories << " ККал" << endl; } int_tmain(intargc, _TCHAR* argv[]) { setlocale(0,""); srand( time( 0 ) ); pulsometer polar; polar.start_timer(); polar.show_timer(); polar.show_pulse(); polar.show_calories(); _getch(); return 0; }