Practice · 2 of 4
Rectangle that validates
CHALLENGE
Difficulty: beginner+25 XP
Implement nested class Solution.Rectangle: constructor (double width, double height) throws ArgumentException unless both are positive; read-only Width/Height; Area(); Scale(double factor) grows **both** dimensions and throws ArgumentException for a non-positive factor.
Press Submit to check your solution.
Back to lesson: Practice: Class workout