Reference no: EM132156717
Assignment
Write a Matlab script that works as below:
1. Take in 2 or 3 integers from the user
2. Ask the user to either choose a division or multiplication operation
3. Ask the user to either continue with the program or to quit
4. If the user chooses to continue, the program will again ask the user to input 2 or 3 integers and choose either a division or multiplication operation
5. If the user chooses to quit, the program will output all the calculations performed in a single image as shown below.
Example of output image for 7 sets of input values:
Distribution of marks:
3 marks Program outputs the image of the whole number of an input value.
Example:
Enter first integer: 568 Output image: 568
6 marks Program outputs the image of the multiplication solution of 2 integers in a single line
5 X 2 = 10
9 marks Program outputs the image of the division solution of 2 integers, including decimal places, in a single line
32/65 = 0.4923 I
12 marks Program outputs the image of the multiplication solution of 3 integers in a single line
5 x 6 x 8 = 240
15 marks Program outputs the image of the division solution of 3 integers, including decimal places, in a single line
23/43/12 = 0.044574
20 marks Program outputs the image of the solutions for multiple pairs of integers in multiple lines
22 marks Program does an error check to make sure that the divisional operation does not involves a division with zero. If zero was input as a 2nd or 3rd value for the division operation, the program will ask the user to re-enter the 2nd or 3rd value until a non-zero integer is entered.
25 marks Program outputs the image of the solutions for multiple pairs of integers in multiple lines, with the 1st multiplication/division symbol and the equal symbol aligned in a column.
Attachment:- Assignment.rar