Word problems involving piecewise functions with solution