Cody

Problem 44445. Tax Calculator

Solution 3384053

Submitted on 26 Oct 2020 by Farhan Gony
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
income = 0; tax_correct = 0; assert(isequal(taxFor(income),tax_correct))

x = 0 y = 0 z = 0

2   Pass
income = 100; tax_correct = 10; assert(isequal(taxFor(income),tax_correct))

x = 10 y = 0 z = 0

3   Pass
income = 1000; tax_correct = 100; assert(isequal(taxFor(income),tax_correct))

x = 100 y = 0 z = 0

4   Pass
income = 2000; tax_correct = 200; assert(isequal(taxFor(income),tax_correct))

x = 200 y = 0 z = 0

5   Pass
income = 2500; tax_correct = 300; assert(isequal(taxFor(income),tax_correct))

x = 200 income = 500 y = 100 z = 0

6   Pass
income = 3000; tax_correct = 400; assert(isequal(taxFor(income),tax_correct))

x = 200 income = 1000 y = 200 z = 0

7   Pass
income = 5000; tax_correct = 1000; assert(isequal(taxFor(income),tax_correct))

x = 200 income = 3000 y = 200 income = 2000 z = 600

8   Pass
filetext = fileread('taxFor.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')

Suggested Problems

More from this Author25

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!