Menu

[Solved]Create Bash Script Creates Multiplication Table Like Mine 1 23 45 678 9 10 11 12 9 10 11 1 Q37177065

Create a BASH Script that creates a multiplication table.

Create a BASH script that creates a multiplication table like mine 1 23 45 678 9 10 11 12 9 10 11 12 8 10 12 14 16 18 20 22 2

Create a BASH script that creates a multiplication table like mine 1 23 45 678 9 10 11 12 9 10 11 12 8 10 12 14 16 18 20 22 24 9 12 15 18 21 24 2730 33 36 8 12 16 20 24 28 3236 40 44 48 5 10 15 20 25 30 35 40 45 50 55 60 6L 612 18 24 30 36 424854 60 66 72 7L 714 21 28 35 42 49 56 63 70 7784 8L 816 24 32 40 48 56 6472 80 88 96 9 9 18 27 36 4554 6372 81 90 99 108 10 20 30 40 50 60 70 80 90 100 110 120 11 22 33 44 55 66 77 88 99 110 121 132 12 L 12 2436 48 60 72 84 96 108 120 132 144 3 6 7 4 L 4 You must use nested, C-style for-loops to construct the table! A suggestion on how to structure your code output header lines for each row do output the leftmost column and divider for each column do output row times column output end of line done It might be handy to be able to format your output so that all the numbers line up. Use the printf command! man printf, then see this example printf “%3d” $var which will output the number stored in $var in a space exactly 3 characters wide. Want to add some more space around it, to separate it from the other numbers in the table? or printf “6d”$var Show transcribed image text Create a BASH script that creates a multiplication table like mine 1 23 45 678 9 10 11 12 9 10 11 12 8 10 12 14 16 18 20 22 24 9 12 15 18 21 24 2730 33 36 8 12 16 20 24 28 3236 40 44 48 5 10 15 20 25 30 35 40 45 50 55 60 6L 612 18 24 30 36 424854 60 66 72 7L 714 21 28 35 42 49 56 63 70 7784 8L 816 24 32 40 48 56 6472 80 88 96 9 9 18 27 36 4554 6372 81 90 99 108 10 20 30 40 50 60 70 80 90 100 110 120 11 22 33 44 55 66 77 88 99 110 121 132 12 L 12 2436 48 60 72 84 96 108 120 132 144 3 6 7 4 L 4 You must use nested, C-style for-loops to construct the table! A suggestion on how to structure your code output header lines for each row do output the leftmost column and divider for each column do output row times column output end of line done It might be handy to be able to format your output so that all the numbers line up. Use the printf command! man printf, then see this example printf “%3d” $var which will output the number stored in $var in a space exactly 3 characters wide. Want to add some more space around it, to separate it from the other numbers in the table? or printf “6d”$var

Expert Answer


Answer to Create a BASH script that creates a multiplication table like mine 1 23 45 678 9 10 11 12 9 10 11 12 8 10 12 14 16 18 20… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *