フィルターのクリア

How to compute for finalToll

4 ビュー (過去 30 日間)
ELIZA BAUTISTA
ELIZA BAUTISTA 2020 年 7 月 25 日
コメント済み: David Hill 2020 年 7 月 25 日
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
  1 件のコメント
David Hill
David Hill 2020 年 7 月 25 日
What have you tried?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by