Question: Problem 2 : ( based on problem 1 on page 7 6 ) Using matlab write a function with header [ tip ] = myTipCalc

Problem 2: (based on problem 1 on page 76) Using matlab write a function with header
[tip]= myTipCalc(bill, party)
Where bill is the total cost of a meal and party is the number of people in the group. The tip should be calculated as 15% for a party of less than 6,18% for a party less than 8, and 20% for a party of 8 or larger. It should give an error if the bill or the party is less than or equal to 0. Test cases:
>>t= myTipCalc (109.29,3)
t=16.3935
>>t= myTipCalc (109.29,7)
t=19.6722
>>t= myTipCalc (109.29,12)
t=21.8580
 Problem 2: (based on problem 1 on page 76) Using matlab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!