Please can someone help me with these questions it would be much
appreciated?
II MATLAB Grader Mason Wakeling DI = CONTENTS Close Courses & Content LMS Integration Documentation & Support Your toy store is having a sale! Customers have two ways to save money: V MATLAB summative assessment • Promotion 1: If they buy six items or more they get 20% off on their most expensive item. • Promotion 2: If their bill total (before tax) is greater than $100 they will get 10% off their entire bill. Customers can combine this deal with promotion 1 if their total bill is still over $100 after the 20% reduction on their most expensive item. MATLAB Fundamentals - Math Expression Write a function named cashRegister to implement this promotion. Your function should accept two inputs in order as follows: MATLAB Fundamentals - Trig functions MATLAB Fundamentals - Variables and Data Types • A single 1x2 cell array. The first cell contains a single column cell array of character vectors describing the items to be purchased. The second cell contains a column vector that represents the corresponding prices of those items. Note that these prices are listed before tax is added. • A scalar variable with the sales tax rate in decimal form (e.g. 8.8% sales tax would be an imput of 0.088). This sales tax should be added to the bill total after applying the promotions (e.g. if the cost is 100 after promotions, and the sales tax is 8.8% the customer would pay 108.8) MATLAB Fundamentals - Cylinder Volume The function should calculate the final bill by implementing the promotion described above and applying the input sales tax rate of 8.8% to the pre- tax subtotal. The function should generate the following three outputs: MATLAB Fundamentals - While loop MATLAB Fundamentals - Sales Promotions 1. A cell array variable representing the total savings from promotion 1. The first cell should contain the name of the most expensive item. The second cell should hold the savings on that item. Assign this variable the cell array { 'None', 0} if the purchase does not qualify. . 2. A scalar variable representing the total savings from promotion 2. Assign this variable the value to o if the purchase did not qualify for this promotion) 3. A scalar variable representing the total bill. X MATLAB Fundamentals - Quality control
Function @ C Reset MATLAB Documentation 1 function [promotioni, promotion2, totalBill] cashRegister(itemList, taxRate) 2
Code to call your function ® Reset ز 1 %example purchase that satisfies criteria for both promotions 2 itemDescriptions = {'Dice Set'; 'Model Car';'Jump Rope'; 'Science Kit'; 'Puzzle'; 'Board Game'; 'Stuffed Animal'}; 3 itemCosts = [7.98; 14.99; 8.99; 34.95; 21.99; 19.99; 11.95]; 4 itemList = {itemDescriptions, itemCosts}; 5 taxRate = 0.088; 6 [promotions, promotion2, totalBill] = cashRegister(itemlist, taxRate) 7 8 % PLEASE NOTE to get the descriptions and costs out of itemlist you can do: 9 % itemDescriptions = itemList{1} 10% itemCosts = itemlist{2} Run Function 2
Assessment: Run Pretest Are the first two outputs correct for a purchase that only qualifies for promotion 1? (Pretest) Is the total bill (third output) correct for a purchase that only qualifies for promotion 1? (Pretest) Are the first two outputs correct for a different purchase that only satisfies promotion 2? Is the total bill (third output) correct for a purchase that only qualifies for promotion 2? Are all three outputs correct for a purchase that satisfies both promotions? Are all three outputs correct for a purchase that does not qualify for any promotions? Are all three outputs correct for a different tax rate?
Please can someone help me with these questions it would be much appreciated?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Please can someone help me with these questions it would be much appreciated?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!