Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Coding Guidelines for All L Assignments (You will be graded on this) Give identi

ID: 2267876 • Letter: C

Question

Coding Guidelines for All L Assignments (You will be graded on this) Give identifiers semantic meaning and make them easy to read (examples qumStudeots, grossPasuctc) Keep identifiers to a reasonably short length. Use upper case for constants. Use title case (first letter is upper case) for classes. Use lower case with uppercase word . . separators for all other identifiers (variables, methods, objects). Use tabs or spaces to indent code within blocks (code surrounded by beaces). This includes classes, methods, and code associated with ifs, switches and loops. Be consistent with the number of spaces or tabs that you use to Use white space to make your program more readable. Use comments properly before or after the ending brace of classes, methods, and blocks to identify to which block it belongs. One of the services provided by Desert Mountain Landscaping (DML) is the sale of custom-designed garden crates, these crates have standardized width and height, but vary in length, so they will be priced by length, meanwhile due to delivery limitation, the maximum length of the crate cannot exceed 9 feet. Customer also have the following choices purchasing a crate on a "cash and carry" basis purchasing a crate and have it delivered to customer's home purchasing a crate and have it planted with seasonal flowers and delivered to customer's home The following table lists DML crates pricing information · Crate Length less than 1 foot 1 to 3 feet 4 to 6 feet 7 to 9 feet delivery only (per crate) delivery + planting Price $9.90 per pioce $39.75 pe $69.35 per piece $119.50 per pioce $20.00 (S100 max. per ondc 50% ofthe total cost ofthe crates In this assignment, you will need to develop a program that uses the number ofcrates purchased their length, and the · formation to create a customer invoice. To simplity the program, you may assume that all crates purchased by a customer are the same length 2. Program design Your program need carry out the following steps: 1. Have the user input the number of crates purchased and their length. 2. Check the length, make sure it does not exceed 9 feet. 3. Have the user indicate if the erates will be planted with seasonal flowers or not. 4. If planting service is not desired, have the user indicate if they want delivery or not. 5. Calculate the total crates cost. 6. Calculate the planting and delivery charges. 7. Calculate the total of all charges 8. Print a bill that displays the purchase information and all charges Note: e you need to pick a proper data type and declare constants for each of the price listed in above table . Use indention properly to make the if. iCels structure easy to read For output, your program should follow our sample run's output format. The exact spacing is not necessary, but your output should be similar to our solution output. Also, as we stated before, for each assignment, put the following comment header on top of the file .

Explanation / Answer

Hello,
          Please find the answer attached as under. Please give a thumbs up rating if you find the answer useful! Have a rocking day ahead!
*** Matlab Code ***

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Crate delovery and pricing scheme


clc;
prompt = 'How many crates? ';               % user enters a number below 9
n = input(prompt);

if(n>9)
    fprintf('A maximum of 9 units only can be ordered. Thank you! ');
else
    prompt = 'Whats the length of each crate? ';    % for length input
    l = input(prompt);

    prompt = 'Press 1 for delivery + planting, 2 for delivery only OR 3 for pick up ';    % for service input
    choice = input(prompt);

    if(l<1)
        cost1 = (n*9.9);
    end

    if(l>=1 & l<=3)
        cost1 = (n*39.75);
    end


    if(l>=4 & l<=6)
        cost1 = (n*69.35);
    end

    if(l>=7 & l<=9)
        cost1 = (n*119.5);
    end

    if(choice == 1)
        cost2 = 0.5*cost1;
    end

    if(choice == 2)
        cost2 = min(n*20,100);
    end

    if(choice == 3)
        cost2 = 0;
    end

    fprintf(' ----------------- Invoice ----------- ');
    fprintf('Cost of crate =$ %f ',cost1);
    fprintf('Cost of delivery + planting =$ %f ',cost2);
    fprintf('TOTAL =$ %f ',cost1+cost2);
   
end

**** End of Code *****

Output on prompt:

How many crates? 3
Whats the length of each crate? 4
Press 1 for delivery + planting, 2 for delivery only OR 3 for pick up 1

----------------- Invoice -----------
Cost of crate =$ 208.050000
Cost of delivery + planting =$ 104.025000
TOTAL =$ 312.075000