統計
MATLAB Answers
1 質問
0 回答
ランク
of 171,413
コントリビューション
0 問題
0 解答
スコア
0
バッジ数
0
コントリビューション
0 投稿
コントリビューション
0 パブリック チャネル
平均評価
コントリビューション
0 ハイライト
平均いいねの数
Feeds
質問
Write a function called fare that computes the bus fare one must pay in a given city based on the distance travelled. Here is how the fare is calculated: the first mile is $2. Each additional mile up to a total trip distance of 10 miles is 25 cents.
my code is function [fare] = fare(a,d) if d<=1 fare = 2; elseif d<=10 fare = 2+0.25*(d-1); else ...
8年弱 前 | 1 件の回答 | 0