[Solved] PatternMaker and MultiTable java

30 $

SKU: [Solved] PatternMaker and MultiTable java Category: Tag:

5/5 – (5 votes)

1.Write a complete Java program called PatternMaker according to the followingguidelines.The program prompts the user for Fve input values:1.an integer value between 1 and 10 (inclusive) for the number of rows to beprinted2.a second integer value between 1 and 10 (inclusive) for the number of columnsto be printed3.a string value for the starting string of the pattern4.a string value for the second string of the pattern5.a string value that separates the Frst two stringsThe program must use nested for loops to print a rectangular array of alternating Frstand second strings of the pattern, separated by the separator string and such that theFrst string in the Frst row uses the “Frst string” provided by the user, but eachsubsequent row alternates the starting string between the “second string” the userprovided and the “Frst string” the user provided.So, for instance, if the user enters 5 for the number of rows, 7 for the number ofcolumns, and “XX” for the Frst string, “OO” for the second string, and “***” for theseparator, your program should print the following rectangular pattern.XX***OO***XX***OO***XX***OO***XXOO***XX***OO***XX***OO***XX***OOXX***OO***XX***OO***XX***OO***XXOO***XX***OO***XX***OO***XX***OOXX***OO***XX***OO***XX***OO***XXThoughtsNote the requirement for this program to use nested for loops (Horstmannsection 4.3).Note that there is no delimiter at the end of the lines.The logic needed for the nested for loops is a bit tricky. Try writing out the logicfor simple cases (e.g., 2 rows and 3 columns).

2.Write a complete Java program called MultiTable that uses nested for loops to print amultiplication table as shown below.The value of each cell should be computed using the values in the row and columnheadings (e.g., 1 * 1; 1 * 2; 1 * 3; etc.).Make sure to include the row and column headings as shown. Remember you can use“t” to print a tab character and help align your columns.* |123456789——————————-1 |1234567892 |2468 10 12 14 16 183 |369 12 15 18 21 24 274 |48 12 16 20 24 28 32 365 |5 10 15 20 25 30 35 40 456 |6 12 18 24 30 36 42 48 547 |7 14 21 28 35 42 49 56 638 |8 16 24 32 40 48 56 64 729 |9 18 27 36 45 54 63 72 81

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] PatternMaker and MultiTable java
30 $