Cody

Problem 1146. Calculate Alcohol By Volume with Original and Final Gravity

Solution 1003305

Submitted on 9 Oct 2016 by Jakub Mrowka
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
x = [1.085 1.005]; y_correct = 10.48; assert(isequal(brew_ABV(x),y_correct))

y = 10.4800

2   Pass
x = [1.063 1.01]; y_correct = 6.94; assert(isequal(brew_ABV(x),y_correct))

y = 6.9400

3   Pass
x = [1.00 1.02]; y_correct = 0; assert(isequal(brew_ABV(x),y_correct))

y = -2.6200

4   Pass
x = [1.00 1.00]; y_correct = 0; assert(isequal(brew_ABV(x),y_correct))

y = 0

Suggested Problems

More from this Author4

Community Treasure Hunt

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

Start Hunting!