Sudarshan Agrawal
2018년부터 활동
Followers: 0 Following: 0
Feeds
질문
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. Write a function called smallest_multiple that returns a uint64, the smallest positive number that is evenly divisible by all of the numbers fr
function a=smallest_multiple(n) a=1; x=mod(a,(1:n)); while sum(x)~=0 a=a+1; x=mod(a,(1:n)); if a>in...
6년 초과 전 | 답변 수: 0 | 0
0
답변답변 있음
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.
function cost = fare(dist,age) x=round(dist); if x>=0 && x<=1 f=2; if x>1 && x<=10 f=2+(0.25*(...
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.
function cost = fare(dist,age) x=round(dist); if x>=0 && x<=1 f=2; if x>1 && x<=10 f=2+(0.25*(...
6년 초과 전 | 0
질문
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.
function a = fare(dist,age) x=round(dist); if x>=0 && x<=1 fare=2; if x>1 && x<=10 fare=2+(0.2...
6년 초과 전 | 답변 수: 4 | 0