Question: 4. Write a local function DealType(x), x representing how many percentages off is in the deal. The dealType is define as follows: Deal Type Percentages

 4. Write a local function DealType(x), x representing how many percentages

4. Write a local function DealType(x), x representing how many percentages off is in the deal. The dealType is define as follows: Deal Type Percentages off Fair Deal x=90 Use if-elseif-else statement (if you know switch statement, you can use switch instead) to implement the function and use fprintf outside the function to complete the output. For each segmentation, there should be a test case percentage number picked by yourself (Hint: use floor function to round a number to the next smaller integer.) The output should look like: Problem 4 5 percent off is a Fair Deal. 25 percent off is a Good Deal. 60 percent off is a Great Deal. 95 percent off is a Mistake. Submission should include 3 files: and lab5_output.txt, lab5.m and pickone.m. Be sure to include the header information in all .m files and three parts separated by --------'(Part I: personal info, Part II: two .m files, Part III: output result from command window) as usual in lab5_output.txt

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!