Mini Project

Medium Classes & Objects
Solve in Playground →

Problem Statement

Write a C++ program implementing a console-based employee management task using a `Staff` class that processes records and displays details.

Input Format

Number of records N, followed by N lines of ID (int), Name (string), and Salary (double).

Output Format

Print records of all entered staff members.

Constraints

1 <= N <= 20

Sample Input

2
101 John 45000.0
102 Alice 55000.5

Sample Output

ID: 101, Name: John, Salary: 45000.00
ID: 102, Name: Alice, Salary: 55000.50

Explanation

Integrates classes and array processing for batch record management.

Starter Code

#include <iostream>
#include <string>
#include <iomanip>

class Staff {
public:
    int id;
    std::string name;
    double salary;
    
    void display() {
        // Write your code here
    }
};

int main() {
    int n;
    if (std::cin >> n) {
        Staff staff[20];
        for (int i = 0; i < n; ++i) {
            std::cin >> staff[i].id >> staff[i].name >> staff[i].salary;
        }
        for (int i = 0; i < n; ++i) {
            staff[i].display();
        }
    }
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

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