Mobile Phone

Easy Classes & Objects
Solve in Playground →

Problem Statement

Write a C++ program defining a `Mobile` class with brand, model, and price, and displaying phone specifications.

Input Format

Brand (string), Model (string), and Price (double).

Output Format

Print mobile phone specifications.

Constraints

Price >= 0

Sample Input

Apple iPhone13 799.00

Sample Output

Brand: Apple, Model: iPhone13, Price: 799.00

Explanation

Models product specifications using class members.

Starter Code

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

class Mobile {
public:
    std::string brand;
    std::string model;
    double price;
    
    void display() {
        // Write your code here
    }
};

int main() {
    Mobile mob;
    if (std::cin >> mob.brand >> mob.model >> mob.price) {
        mob.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