Statistics
1 Question
0 Answers
RANK
61,546
of 300,863
REPUTATION
0
CONTRIBUTIONS
1 Question
0 Answers
ANSWER ACCEPTANCE
0.0%
VOTES RECEIVED
0
RANK
of 21,100
REPUTATION
N/A
AVERAGE RATING
0.00
CONTRIBUTIONS
0 Files
DOWNLOADS
0
ALL TIME DOWNLOADS
0
RANK
of 171,413
CONTRIBUTIONS
0 Problems
0 Solutions
SCORE
0
NUMBER OF BADGES
0
CONTRIBUTIONS
0 Posts
CONTRIBUTIONS
0 Public Channels
AVERAGE RATING
CONTRIBUTIONS
0 Discussions
AVERAGE NO. OF LIKES
Feeds
Question
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 years ago | 1 answer | 0