From d0f88b3bc3d89d52aa1f2c27507eaf0d76f2a703 Mon Sep 17 00:00:00 2001 From: Angeld55 Date: Mon, 23 Sep 2019 23:47:50 +0300 Subject: Add files via upload --- Big4/InformaticsStudent.cpp | 15 +++++++++++++-- Big4/InformaticsStudent.h | 5 ++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Big4/InformaticsStudent.cpp b/Big4/InformaticsStudent.cpp index f158e7f..6c69f4e 100644 --- a/Big4/InformaticsStudent.cpp +++ b/Big4/InformaticsStudent.cpp @@ -1,6 +1,17 @@ #include "InformaticsStudent.h" +#include +bool hasDigits(const char* str,int len) +{ + for (int i = 0; i < len;i++) + { + if (str[i] >= '0' && str[i] <= '9') + return true; + } + return false; +} + void InformaticsStudent::CopyFrom(const InformaticsStudent& other) { int len = strlen(other.name); @@ -85,7 +96,7 @@ int InformaticsStudent::getFn() const return fn; } -void InformaticsStudent::printStudent() +void InformaticsStudent::printStudent() const { - cout << name << " fn: " << fn << endl; + std::cout << name << " fn: " << fn << std::endl; } diff --git a/Big4/InformaticsStudent.h b/Big4/InformaticsStudent.h index 7477b2b..6e9d743 100644 --- a/Big4/InformaticsStudent.h +++ b/Big4/InformaticsStudent.h @@ -7,6 +7,9 @@ // 4.Destructor ~InformaticsStudent() // (Най-лесно е като си разпишем функция за копиране CopyFrom и функция за триене Free()) +#pragma once +#include + class InformaticsStudent { private: @@ -32,6 +35,6 @@ public: const char* getName() const; int getFn() const; - void printStudent(); + void printStudent() const; }; -- cgit v1.3.1-23-gd82d