Question
CREATE A METHOD that RETURNS A STRING formatted as the multiplication table of N from 1 up to and including X. You can assume N
CREATE A METHOD that RETURNS A STRING formatted as the multiplication table of N from 1 up to and including X. You can assume N will be a whole number and wont be large enough to cause overflow. You can assume that X will be a positive whole number greater than or equal to 1
Example output for N = 7, X = 9: 7_*_1_=_7 7_*_2_=_14 7_*_3_=_21 7_*_4_=_28 7_*_5_=_35 7_*_6_=_42 7_*_7_=_49 7_*_8_=_56 7_*_9_=_63
PLEASE NOTE: The underscores (_) should be spaces ( ) and the arrows () should be replaced with carriage returns. Ive included them here to draw attention to the fact that there should be spaces between the characters. There should also be a newline after the last line.
/** For N=1,n=10 this prints: 1 * 1 = 1 1 * 2 = 2 1 * 3 = 3 1 * 4 = 4 1 * 5 = 5 1 * 6 = 6 1 * 7 = 7 1 * 8 = 8 1 * 9 = 9 1 * 10 = 10 */ public String printPattern(int n) { // Do something here }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started