1. A gratuity (also called a tip) is a sum of money customarily given by a client...
Question:
1. A gratuity (also called a tip) is a sum of money customarily given by a client or customer to a service worker in addition to the basic price. It is common for certain countries especially in the West. You are asked to make a MATLAB's program to calculate the tip based on amount of bills, using the following rules;
• bill less than S10, tip is $ 1.80
• bill is between $10 and $60, tip is 18%
• bill is above $60, tip is 20%
a) Draw a flowchart for the problem.
b) Write the MATLAB's code for the problem that will also ask the user for the input and finally will display the tip's amount.(10 marks)
2. Write a MATLAB's code for converting centimeter unit (input x) to different units including inch, feet, meter, and milimeter. You must use switch-case commands. (10 marks)
3. Write a MATLAB's program that will use a while loop to find the smallest number divisible by both 3 and 5, with the square of the number greater than 3325 (10 marks)
Introduction to Financial Accounting
ISBN: 978-0133251036
11th edition
Authors: Charles Horngren, Gary Sundem, John Elliott, Donna Philbrick