Use strict composition. Build `CPU` (takes `float speed`) and `RAM` (takes `int size`) classes. Build a `Computer` class that takes both inputs and instantiates `CPU` and `RAM` internally as direct objects (not pointers) using an initializer list. Add a `specs()` method that prints ‘CPU: [speed]GHz\nRAM: [size]GB’.
A float (CPU speed) and an integer (RAM size) separated by space.
Print the specs using strict formatting.
None
3.5 16
CPU: 3.5GHz
RAM: 16GB
A complete composition example. The computer manages the strict lifecycles of its internal hardware components.
#include <iostream>
class CPU {
public:
// Write your code here
};
class RAM {
public:
// Write your code here
};
class Computer {
public:
// Write your code here
};
int main() {
// Construct computer and show specs
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