Question

0 solutions submited (max Unlimted Wrte a MATLAB program called PaidPennies that calculates how much a person would eam e the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hey,

Note: Brother function file are not meant to be run directly they are either run through the command window or some script and should be saved with the same name mentioned below. In case of any queries brother just comment in box I would be very happy to assist all your queries.  

==================================

Save file as PaidPennies.m

=================================

function S=PaidPennies(days)
S=0;
for i=1:days
S=S+i;
end
S=S/100;
end

================================

Execcutable file

===============================

clc
clear all
close all
days=input('How many days of eemployement: ');
fprintf('Being employed for %d days earns $%.2f\n',days,PaidPennies(days));

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
0 solutions submited (max Unlimted Wrte a MATLAB program called PaidPennies that calculates how much a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT