What have you tried?
How to compute for finalToll
10 次查看(过去 30 天)
显示 更早的评论
Complete the example to calculate final Toll. The base toll for a bridge is base Toll. If the vehicle's weight is over 5,000 pounds, then an additional 4 pesos is added to the toll. Lastly, the toll amount is doubled due to heavy traffic.
Starter code
function finalToll = CalculateToll(baseToll, vehicleWeight)
% baseToll: The base toll to cross a bridge in pesos
% vehicleWeight: Weight of a vehicle in pounds
% Assign finalToll with baseToll
finalToll = 0;
% If vehicle's weight is over 5,000 pounds, increase toll by 4 pesos
% Double toll amount due to heavy traffic
end
Assessments
Check if CalculateToll(10, 3500) returns 20
Check if CalculateToll(15, 6200) returns 38
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Measurements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!