about | help | code help+videos | done | prefs |
test2023_11_16_APP1SLHL_mathProblem
Write a method that returns a string that represents the calculation and result of performing either addition or subtraction on 'x' and 'y'. The only acceptable operations are "+" or "-". Any other value for 'operation' results in the string "error" being returned. Look at the test data for examples. test2023_11_16_APP1SLHL_mathProblem(-80, 30, "+") → "-80+30=-50" test2023_11_16_APP1SLHL_mathProblem(5, 5, "-") → "5-5=0" test2023_11_16_APP1SLHL_mathProblem(71, 22, "this does not work") → "error" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 250
Copyright Nick Parlante 2017 - privacy