Filter löschen
Filter löschen

How to compute for finalToll

4 Ansichten (letzte 30 Tage)
ELIZA BAUTISTA
ELIZA BAUTISTA am 25 Jul. 2020
Kommentiert: David Hill am 25 Jul. 2020
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

Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by