Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Access and Mutator Practice | Encapsulation Overview
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

Access and Mutator Practice

Завдання

  • Finish an implementation of a class called Vault that simulates a secure vault for storing a message with a password.
    • Implement the get_message() method that should return the stored message if the provided password matches the vault's password otherwise return an empty string or some suitable indication.
    • Implement the set_message() method, which takes two parameters, a new message and the current password. This method should allow changing the message only if the current password matches the vault's password.
    • Implement the set_password() method that takes two parameters, a new password and the old password. It should change the vault's password to the new one if the old password matches the current password.

Завдання

  • Finish an implementation of a class called Vault that simulates a secure vault for storing a message with a password.
    • Implement the get_message() method that should return the stored message if the provided password matches the vault's password otherwise return an empty string or some suitable indication.
    • Implement the set_message() method, which takes two parameters, a new message and the current password. This method should allow changing the message only if the current password matches the vault's password.
    • Implement the set_password() method that takes two parameters, a new password and the old password. It should change the vault's password to the new one if the old password matches the current password.

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

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

Секція 3. Розділ 5
toggle bottom row

Access and Mutator Practice

Завдання

  • Finish an implementation of a class called Vault that simulates a secure vault for storing a message with a password.
    • Implement the get_message() method that should return the stored message if the provided password matches the vault's password otherwise return an empty string or some suitable indication.
    • Implement the set_message() method, which takes two parameters, a new message and the current password. This method should allow changing the message only if the current password matches the vault's password.
    • Implement the set_password() method that takes two parameters, a new password and the old password. It should change the vault's password to the new one if the old password matches the current password.

Завдання

  • Finish an implementation of a class called Vault that simulates a secure vault for storing a message with a password.
    • Implement the get_message() method that should return the stored message if the provided password matches the vault's password otherwise return an empty string or some suitable indication.
    • Implement the set_message() method, which takes two parameters, a new message and the current password. This method should allow changing the message only if the current password matches the vault's password.
    • Implement the set_password() method that takes two parameters, a new password and the old password. It should change the vault's password to the new one if the old password matches the current password.

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

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

Секція 3. Розділ 5
toggle bottom row

Access and Mutator Practice

Завдання

  • Finish an implementation of a class called Vault that simulates a secure vault for storing a message with a password.
    • Implement the get_message() method that should return the stored message if the provided password matches the vault's password otherwise return an empty string or some suitable indication.
    • Implement the set_message() method, which takes two parameters, a new message and the current password. This method should allow changing the message only if the current password matches the vault's password.
    • Implement the set_password() method that takes two parameters, a new password and the old password. It should change the vault's password to the new one if the old password matches the current password.

Завдання

  • Finish an implementation of a class called Vault that simulates a secure vault for storing a message with a password.
    • Implement the get_message() method that should return the stored message if the provided password matches the vault's password otherwise return an empty string or some suitable indication.
    • Implement the set_message() method, which takes two parameters, a new message and the current password. This method should allow changing the message only if the current password matches the vault's password.
    • Implement the set_password() method that takes two parameters, a new password and the old password. It should change the vault's password to the new one if the old password matches the current password.

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

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

Завдання

  • Finish an implementation of a class called Vault that simulates a secure vault for storing a message with a password.
    • Implement the get_message() method that should return the stored message if the provided password matches the vault's password otherwise return an empty string or some suitable indication.
    • Implement the set_message() method, which takes two parameters, a new message and the current password. This method should allow changing the message only if the current password matches the vault's password.
    • Implement the set_password() method that takes two parameters, a new password and the old password. It should change the vault's password to the new one if the old password matches the current password.

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