Define a `Person` class. Use the `public` access specifier for a string `name` and the `private` access specifier for an integer `age`. Add a public method `setAge(int a)` to safely update the private age, and a public method `display()` to print the details. In `main()`, instantiate the class, read a name and age, and call the methods.
A string (name) and an integer (age) separated by space.
Print the formatted details.
None
Alice 25
Name: Alice, Age: 25
Encapsulation hides sensitive data (`private`) while exposing a controlled interface (`public`) to interact with that data.
#include <iostream>
#include <string>
class Person {
// Define public and private members here
};
int main() {
// Instantiate Person, read inputs, set data, and display
return 0;
}Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used