GUIDED LAB 01 OF 06 · VERIFIED SCARP

Rectangle area

आयत का क्षेत्रफल

The challenge · अभ्यास

The starter adds width and height. Change the expression so a 6 × 7 rectangle prints its area, 42.

स्टार्टर प्रोग्राम चौड़ाई और ऊँचाई को जोड़ता है। व्यंजक बदलें, ताकि 6 × 7 आयत का क्षेत्रफल 42 प्रिंट हो।

EDIT THIS STARTER

starter.srp

// Lab: change the arithmetic operator to compute the area.
bind width = 6;
bind height = 7;
print(width + height);
MATCH THIS VERIFIED OUTPUT

solution.stdout

Compiler fixture
42

Run and check your attempt locally

Copy starter.srp to attempt.srp in the same lab folder, edit it, and use the pinned Scarp compiler from the repository root. Keeping the same folder is important for imports and the bundled _support helper.

scarp verify labs/01-basics/attempt.srp scarp exec labs/01-basics/attempt.srp

Compare the printed output with the fixture shown above. No website execution, uploads or stored answers are involved.

Show hint · संकेत देखें

Look at the operator inside print. Area is width multiplied by height.

print के अंदर का ऑपरेटर देखें। क्षेत्रफल = चौड़ाई × ऊँचाई।

Reveal tested solution · सत्यापित हल देखें
// Compute the area of a 6 by 7 rectangle.
bind width = 6;
bind height = 7;
print(width * height);

Replacing addition with multiplication produces 6 × 7 = 42.

जोड़ की जगह गुणा करने पर 6 × 7 = 42 मिलता है।

Reference .srp on GitHub ↗

The starter compiles but intentionally does not produce the goal. The reference solution and its output are verified on Linux, macOS and Windows against Scarp v0.0.6-alpha.3. Browse all labs ↗