Question: MATLAB help: **This is what I have so far. It does not pass for CalculateToll(15,6200). CalculateToll(15,6200) is supposed to return 38 but my code returns
MATLAB help:
**This is what I have so far. It does not pass for CalculateToll(15,6200). CalculateToll(15,6200) is supposed to return 38 but my code returns 30.
This code only passes for CalculateToll(10,3500).
CHALLENGE 9.1.2: Bridge to This tcol is pravided by a third party. Your activity is always reourcdetd, but you may need to refresh the page to fill in the banner. annern.ecunded. O ACTIVITY Complete the example to calculate finalToll. The base toll for a bridge is base Toll. If the vehicle's weight is over 5,000 pounds, then an additional 4 dollars is added to the toll. Lastly, the toll amount is doubled due to heavy traffic. Your Function Save CReset MATLAB Documentation 2%Define the function CalculateToll() function finalToll -CalculateToll(basToll, vehicleweight) %Assign finalToll with baseToll. finalToll e %If the vehicle's weight is over 50e, increase the toll by 4 dollars if vehiclelveight 5eee end %Double toll amount by heavy traffic. 10 finalTo11 baseTo11+4; 12 13 14 15 end fina!Toll 2*baseToll ; = 16 Code to call your function C Reset 1CalculateToll(1e, 35e) Run Function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
