Question: matlab coding only QUESTION 2: [CO2 - PO2(C4)] A decorating company wants to produce two multiplication decorating patterns such as in Figure 1. You are
matlab coding only
![matlab coding only QUESTION 2: [CO2 - PO2(C4)] A decorating company wants](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3bcc5deb60_60566f3bcc554979.jpg)
QUESTION 2: [CO2 - PO2(C4)] A decorating company wants to produce two multiplication decorating patterns such as in Figure 1. You are required to develop a program that creates the multiplication pattern separately in 2 different functions. In the beginning of the program, the user is required to enter a digit between 1 to 9. If the user enter a digit outside the range of 1 to 9, an error message will appear, informing the user that the entered digit is out of range. Next, the user needs to choose either the first choice of multiplication decoration pattern (a) or the second choice of multiplication decoration pattern (b). For example, Figure 1(a) shows the output when the user enters the digit 9 for the first option and Figure 1(b) shows the output when the user enters the digit 9 for the second option. [20 MARKS] Enter a digit between 1 to 9: 9 Choice of decoration pattern (1: for increasing order and 2: for decreasing order) : 1 1 2 3 16 20 5 4 6 8 10 12 14 16 18 9 12 15 18 21 24 27 24 7 8 9 28 32 36 25 30 35 40 45 36 42 48 54 49 56 63 64 72 81 (a) Enter a digit between 1 to 9:9 Choice of decoration pattern (1: for increasing order and 2: for decreasing order) : 2 72 64 81 9 8 7 6 5 4 27 24 21 18 15 63 56 49 18 16 14 12 10 8 6 4 36 32 28 24 20 16 45 40 35 30 25 54 48 42 36 9 1 (b) QUESTION 2: [CO2 - PO2(C4)] A decorating company wants to produce two multiplication decorating patterns such as in Figure 1. You are required to develop a program that creates the multiplication pattern separately in 2 different functions. In the beginning of the program, the user is required to enter a digit between 1 to 9. If the user enter a digit outside the range of 1 to 9, an error message will appear, informing the user that the entered digit is out of range. Next, the user needs to choose either the first choice of multiplication decoration pattern (a) or the second choice of multiplication decoration pattern (b). For example, Figure 1(a) shows the output when the user enters the digit 9 for the first option and Figure 1(b) shows the output when the user enters the digit 9 for the second option. [20 MARKS] Enter a digit between 1 to 9: 9 Choice of decoration pattern (1: for increasing order and 2: for decreasing order) : 1 1 2 3 16 20 5 4 6 8 10 12 14 16 18 9 12 15 18 21 24 27 24 7 8 9 28 32 36 25 30 35 40 45 36 42 48 54 49 56 63 64 72 81 (a) Enter a digit between 1 to 9:9 Choice of decoration pattern (1: for increasing order and 2: for decreasing order) : 2 72 64 81 9 8 7 6 5 4 27 24 21 18 15 63 56 49 18 16 14 12 10 8 6 4 36 32 28 24 20 16 45 40 35 30 25 54 48 42 36 9 1 (b)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
