Input and Output in MATLAB; Script .m files An online retailer has hired you to
ID: 3668041 • Letter: I
Question
Input and Output in MATLAB; Script .m files An online retailer has hired you to write a MATLAB script to calculate the total cost of a customer's order. The customer may order notebooks or pencils. A notebook is sold for SI.33 and a pencil is sold for $0.25 cents. The shipping cost for the order is simply 8 percent of the total dollar amount of the order, as defined above. Outline: 1. Display a short welcome message to the user 2. Prompt the user to input the number of notebooks being ordered 3. Prompt the user to input the number of pencils being ordered 4. Compute the cost of all of the notebooks ordered 5. Compute the cost of all of the pencils ordered 6. Compute the subtotal of the order, the cost of all the notebooks and all the pencils 7. Compute the shipping cost of the order 8. Compute the total of the order, the subtotal plus the shipping cost 9. Display a billing report, including all of the above indicated amounts, which is formatted in a logical and readable fashionExplanation / Answer
disp('Welcome');
a=input('Enter number of notebooks being ordered');
b=input('Enter number of pencils being ordered');
nb=a*1.33;
pen=b*.25;
disp("Subtotal of Notebook is =");
disp(nb);
disp("Subtotal of Pencil is =");
disp(pen);
tot=nb+pen;
disp("Total amount of order =");
disp(tot);
ship=tot*8/100;
disp("Total shiping cost =");
disp(ship);