Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Constructor Delegation Practice | Constructors and Destructors
C++ OOP
course content

Зміст курсу

C++ OOP

C++ OOP

1. Fundamentals of OOP
2. Constructors and Destructors
3. Encapsulation Overview
4. Inheritance Overview
5. Polymorphism Overview

Constructor Delegation Practice

Завдання

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Завдання

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 6
toggle bottom row

Constructor Delegation Practice

Завдання

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Завдання

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 2. Розділ 6
toggle bottom row

Constructor Delegation Practice

Завдання

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Завдання

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Завдання

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 2. Розділ 6
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt