Inventory

Medium Structures
Solve in Playground →

Problem Statement

Write a C++ program using an `Item` structure (code, quantity, price) to compute total stock inventory asset value.

Input Format

Item Code (int), Quantity (int), Unit Price (double).

Output Format

Print total inventory value formatted to 2 decimal places.

Constraints

Quantity >= 0, Price >= 0

Sample Input

1001 50 12.5

Sample Output

Total Asset Value: 625.00

Explanation

Computes asset value as Quantity * Price using structured records.

Starter Code

#include <iostream>
#include <iomanip>

struct Item {
    int code;
    int qty;
    double price;
};

int main() {
    Item item;
    if (std::cin >> item.code >> item.qty >> item.price) {
        // Write your code here
    }
    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