Private Age

Private Age



🛑 ALL INFORMATION CLICK HERE 👈🏻👈🏻👈🏻

































Private Age
--класс
Person= {}
--тело класса
function Person:new (fName, lName)

-- свойства
local obj= {}
obj.firstName = fName
obj.lastName = lName

-- метод
function obj:getName ()
return self.firstName
end

--чистая магия!
setmetatable (obj, self)
self. __index = self; return obj
end

--создаем экземпляр класса
vasya = Person:new( "Вася" , "Пупкин" )

--обращаемся к свойству
print (vasya.firstName) --> результат: Вася

--обращаемся к методу
print (vasya:getName()) --> результат: Вася


Woman = {}
--наследуемся
setmetatable (Woman ,{ __index = Person})
--проверяем
masha = Woman:new( "Марья" , "Ивановна" )
print (masha:getName()) --->результат: Марья


function extended (child, parent)
setmetatable (child,{ __index = parent})
end


Woman = {};
--наследуемся
extended(Woman, Person)
--проверяем
masha = Woman:new( "Марья" , "Ивановна" )
print (masha:getName()) --->результат: Марья


Person = {}
function Person:new (name)
local private = {}
--приватное свойство
private.age = 18

local public = {}
--публичное свойство
public.name = name or "Вася" -- "Вася" - это значение по умолчанию
--публичный метод
function public:getAge ()
return private.age
end

setmetatable (public,self)
self. __index = self; return public
end

vasya = Person:new()

print (vasya.name) --> результат: Вася

print (vasya.age) --> результат: nil

print (vasya:getAge()) --> результат: 18


Person = {}
function Person:new (name)
local private = {}
private.age = 18

local public = {}
public.name = name or "Вася"

--это защищенный метод, его нельзя переопределить
function public:getName ()
return "Person protected " ..self.name
end

--это открытый метод, его можно переопределить
function Person:getName2 ()
return "Person " ..self.name
end

setmetatable (public,self)
self. __index = self; return public
end

--создадим класс, унаследованный от Person
Woman = {}
extended(Woman, Person) --не забываем про эту функцию

--переопределим защищенный метод
function Woman:getName ()
return "Woman protected " ..self.name
end

--переопределим метод getName2()
function Woman:getName2 ()
return "Woman " ..self.name
end

--проверим
masha = Woman:new()

print (masha:getName()) --> Person protected Вася

print (masha:getName2()) --> Woman Вася


Person = {}
function Person:new (name)
local private = {}
private.age = 18

local public = {}
public.name = name or "Вася"

--это защищенный метод, его нельзя переопределить
function public:getName ()
return "Person protected " ..self.name
end

setmetatable (public,self)
self. __index = self; return public
end

--это открытый метод, его можно
function Person:getName2 ()
return "Person " ..self.name
end


--создадим класс, унаследованный от Person
Woman = {}
extended(Woman, Person) --не забываем про эту функцию

--переопределим метод setName
function Woman:getName2 ()
return "Woman " ..self.name
end

print (masha:getName2()) --> Woman Вася

--вызываем метод родительского класса
print (Person.getName2(masha)) --> Person Вася


function extended (child, parent)
setmetatable (child,{ __index = parent})
end

Person = {}
function Person:new (name)

local private = {}
private.age = 18

local public = {}
public.name = name or "Вася"


--это защищенный метод, его нельзя переопределить
function public:getName ()
return "Person protected " ..self.name
end

--этот метод можно переопределить
function Person:getName2 ()
return "Person " ..self.name
end
setmetatable (public,self)
self. __index = self;
return public
end

--создадим класс, унаследованный от Person
Woman = {}
extended(Woman, Person) --не забываем про эту функцию

--переопределим метод setName
function Woman:getName2 ()
return "Woman " ..self.name
end

masha = Woman:new()
print (masha:getName2()) --> Woman Вася

--вызываем метод родительского класса
print (Person.getName2(masha)) --> Person Вася


from 40,000 to 50,000 ₽ Sabris Москва
from 120,000 to 200,000 ₽ ROGII Новосибирск
to 108,000 ₽ Webit Москва Remote job
from 130,000 ₽ НПК «Катрен» Новосибирск

We email you the best articles monthly


Age Of Wushu Private - World
Lua, ООП и ничего лишнего / Habr
Шнайдер Иван нулевые знания ООП | Бесплатные курсы по ООП MVC в PHP
ArtStation - Private - Age of Waegu, Yuanda Yu
Legal drinking age - Wikipedia
урок 2 задача 5 name = 'Иван'; $employee1 -> age = 25; $employee1 -> salary = 1000; $employee2 = new Employee; $employee2 -> name = 'Вася'; $employee2 -> age = 26; $employee2 -> salary = 2000; echo $employee1 -> salary + $employee2 -> salary.''; echo $employee1 -> age + $employee2 -> age; ?>
урок 4 задача 6 name; } public function getAge() { return $this -> age; } public function getSalary() { return $this -> salary; } public function checkAge() { if ($this -> name > 17) { return true; } else { return false; } } } $employee1 = new Employee; $employee1 -> name = 'Иван'; $employee1 -> age = 25; $employee1 -> salary = 1000; $employee2 = new Employee; $employee2 -> name = 'Вася'; $employee2 -> age = 26; $employee2 -> salary = 2000; echo $employee1 -> getSalary() + $employee2 -> getSalary(); ?>
урок 4 задача 10 17) { $this -> age = $age; } } } $user = new User; $user -> name = 'Коля'; $user -> age = 25; $user -> setAge(30); echo $user -> age; ?>
урок 4 задача 11 salary *= 2; } } $employee = new Employee; $employee -> name = 'Иван'; $employee -> salary = 1000; $employee -> doubleSalary(); echo $employee -> salary; ?>
урок 4 задача 14 width * $this -> height; } public function getPerimeter () { return ($this -> width + $this -> height) * 2; } } $rectangle = new Rectangle; $rectangle -> width = 2; $rectangle -> height = 3; echo $rectangle -> getSquare(); echo ''.$rectangle -> getPerimeter(); ?>
урок 6 задача 6 course + 1; if($this -> isCurseCorrect($nextCourse)){ $this -> course = $nextCourse; } } private function isCurseCorrect($course) { return $course <= 5; } } $student = new Student; $student -> name = 'Иван'; $student -> course = 2; $student -> transferToNextCourse(); echo $student -> course; ?>
урок 7 задача 4 name = $name; $this -> age = $age; $this -> salary = $salary; } } $employee1 = new Employee('Иван', 25, 1000); $employee2 = new Employee('Коля', 27, 2000); echo $employee1 -> salary + $employee2 -> salary; ?>
урок 8 задача 4 setName($name); $this -> setAge($age); $this -> setSalary($salary); } public function setName($name) { $this -> name = $name; } public function getName() { return $this -> name; } public function setAge($age) { if($this -> isAgeCorrect($age)) $this -> age = $age; } public function getAge() { return $this -> age; } public function setSalary($salary) { $this -> salary = $salary; } public function getSalary() { return $this -> salary.'$'; } private function isAgeCorrect($age) { return $age >= 1 and $age <= 100; } } $employee1 = new Employee('Иван', 25, 1500); echo $employee1 -> getSalary(); ?>
урок 9 задача 2 name = $name; $this -> surname = $surname; $this -> salary = $salary; } public function getName() { return $this -> name; } public function getSurname() { return $this -> surname; } public function setSalary($salary) { $this -> salary = $salary; } public function getSalary() { return $this -> salary.'$'; } } $employee1 = new Employee('Иван', 'Шнайдер', 1500); echo $employee1 -> getSalary().''; $employee1 -> setSalary(2000); echo $employee1 -> getSalary(); ?>
урок 11 задача 3 class City { public $name; public $population; public function __construct($name, $population) { $this-> name = $name; $this -> population = $population; } } name.' '.$value -> population.''; } ?>
Урок 13 задача 2 class Arr { private $numbers = []; public function add($num) { $this -> $numbers[] = $num; } public function getAvg() { return (array_sum($this -> $numbers)/count($this -> $numbers)); } } add(1); $arr -> add(2); $arr -> add(3); $arr -> add(4); $arr -> add(5); echo $arr -> getAvg(); ?>
Урок 14 задача 2 class City { public $name; public $foundation; public $population; public function __construct($name, $foundation, $population) { $this -> name = $name; $this -> foundation = $foundation; $this -> population = $population; } } $elem.' '; } ?>
урок 17 задача 2 numbers[] = $elem; } return $this; } public function add ($numbers) { $this -> numbers[] = $numbers; return $this; } public function getSum() { return array_sum($this -> numbers); } } ?> add(1) -> append([2,4]) -> add(3) -> getSum(); ?>
урок 17 задача 3 class User { private $name; private $surname; private $patronymic; public function setName($name) { $this -> name = $name; return $this; } public function setSurname($surname) { $this -> surname = $surname; return $this; } public function setPatronymic($patronymic) { $this -> patronymic = $patronymic; return $this; } public function getFullName() { return substr($this -> surname, 0, 1).substr($this -> name, 0, 1).substr($this -> patronymic, 0, 1); } } setName('Ivan') -> setSurname('Shnaider') ->setPatronymic('Vasilievich') -> getFullName(); ?>
Урок 18 задача 1 getSum($arr, 1); } public function getAvg2($arr) { return $this -> calcSqrt($this -> getSum($arr, 2), 2); } public function getAvg3($arr) { return $this -> calcSqrt($this -> getSum($arr, 3), 3); } public function getAvg4($arr) { return $this -> calcSqrt($this -> getSum($arr, 4), 4); } private function getSum($arr, $power) { $sum = 0; foreach ($arr as $elem) { $sum += pow($elem, $power); } return $sum; } private function calcSqrt($num, $power) { return pow($num, (1 / $power)); } } ?> getAvg3($arr); ?>
урок 19 задачи 3,4 class User { public function setName($name) { $this -> name = $name; } public function setAge($age) { $this -> age = $age; } public function getName() { return $this -> name; } public function getAge() { return $this -> age; } private $name; private $age; } class Employee extends User { public function setSalary($salary) { $this -> salary = $salary; } public function getSalary() { return $this -> salary; } private $salary; } class Programmer extends Employee { public function setLangs($langs) { $this -> langs = $langs; } public function getLangs() { return $this -> langs; } private $langs; } class Driver extends Employee { public function setExp($exp) { $this -> exp = $exp; } public function getExp() { return $this -> exp; } public function setCategory($category) { $this -> category = $category; } public function getCategory() { return $this -> category; } private $exp; private $category; }
Урок 21 задачи 1,2 class User { private $name; private $age; public function setName($name) { if(strlen($name) > 3){ $this -> name = $name; } } public function setAge($age) { $this -> age = $age; } public function getName() { return $this -> name; } public function getAge() { return $this -> age; } } class Student extends User { private $course; public function setName($name) { if(strlen($name) < 10){ parent::setName($name); } } public function setCourse($course) { $this -> course = $course; } public function getCourse() { return $this -> course; } }
Урок 22 задача 2-6 class User { private $name; private $surname; private $birthday; private $age; public function __construct($name, $surname, $birthday) { $this -> surname = $surname; $this -> name = $name; $this -> birthday = $birthday; $this -> age = $this -> calculateAge($birthday); } public function getAge() { return $this -> age; } public function getBirthday() { return $this -> birthday; } public function getName() { return $this -> name; } public function getSurname() { return $this -> surname; } private function calculateAge($birthday) { $arr = explode('-', $birthday); $age = date('Y') - $arr[0]; if (date('z') < date('z',mktime(0 ,0 ,0 , $arr[1], $arr[2], 0))){ $age--; } return $age; } } class Employee extends User { private $salary; public function __construct ($name, $surname, $birthday, $salary) { parent::__construct($name, $surname, $birthday); $this -> salary = $salary; } public function getSalary() { return $this -> salary; } }
Урок 23 задача 1-3 class Product { private $name; private $price; public function __construct ($name, $price) { $this -> name = $name; $this -> price = $price; } public function getName() { return $this -> name; } public function getPrice() { return $this -> price; } } getName(); echo '-'.$product2 -> getPrice().''; echo $product1 -> getName(); echo '-'.$product1 -> getPrice(); ?>
Урок 24 задача 2-4 getAvg($rez)); } } class Arr { private $nums = []; private $avgHelper; public function __construct() { $this -> avgHelper = new AvgHelper; } public function getAvgMeanSquare() { $nums = $this -> nums; return $this -> avgHelper -> getMeanSquare($nums) + $this -> avgHelper -> getAvg($nums); } public function add($number) { $this -> nums[] = $number; } } ?>
Ваш браузер устарел. Попробуйте браузер Atom , чтобы работа ВКонтакте была быстрой и стабильной. Подробнее

Double Penetration Kiss
Russian Mature Ass
Pierced Lesbian
Caroline Pierce Porn Pics
Penetration 3
_age_15-74" width="550" alt="Private Age" title="Private Age">_EU-27" width="550" alt="Private Age" title="Private Age">_2012.png" width="550" alt="Private Age" title="Private Age">

Report Page