Implement a `Player` class and a `Team` class. The `Team` class takes an existing `Player` pointer via a method `addPlayer(Player* p)`. Read a player name and team name, instantiate them separately, link them using the method, and print ‘[player] joined [team]’.
Two strings: Player name then Team name.
Print the formatted joining message.
No spaces in names.
Alice Warriors
Alice joined Warriors
Aggregation represents a weak 'has-a' relationship where the child object can exist independently of the parent, utilizing pointers.
#include <iostream>
#include <string>
class Player {
public:
// Write your code here
};
class Team {
public:
// Write your code here
};
int main() {
// Create objects, use aggregation, and print
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