Shopping Cart and Checkout System

Easy Applied C++ OOP Mini Projects
Solve in Playground →

Problem Statement

Create `Item` (name, price) and `Cart` (add_item, get_total) classes. Read N item entries (name, price) to add to the cart and print the final checkout total formatted to exactly 2 decimal places.

Input Format

Line 1: N operations. Next N lines: item name and price float.

Output Format

Print total cost with 2 decimal places.

Constraints

1 <= N <= 20

Sample Input

2
Apple 1.50
Banana 0.75

Sample Output

2.25

Explanation

Sum of 1.50 + 0.75 is 2.25.

Starter Code

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

class Item {
public:
    // Write your code here
};

class Cart {
public:
    // Write your code here
};

int main() {
    // Implement I/O logic 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