I\'m in java one and i need help with this code. I have to print out a multiplic
ID: 3677903 • Letter: I
Question
I'm in java one and i need help with this code. I have to print out a multiplication table with 11 rows and 9 columns. can somebody help me with this code.thanks
Programming Concepts
1. forloops
Exercise Location
For this exercise, you will copy a program from my directory into yours. It doesn't matter what directory this exercise is located in. You will need to copy this command and paste it into Loki:
cp ~lkoperski/1404_Lab/Exercises/Exercise09.java .
Exercise Description
You will print out a multiplication table with 11 rows and 9 columns.
Exercise Suggestions
If we printed out the numbers 9 and 10, using these two print statements:
System.out.println(9);
System.out.println(10);
The output would look like this (the numbers are left justified):
9
10
So to print out the numbers right justified, we could use these two print statements:
System.out.printf("%2d ", 9); System.out.printf("%2d ", 10);
And the output would look like this:
9
10
To explain in further detail, the %2d format specifier means to print out the integer in a field width of 2, right justified. We use 2, because the maximum number of digits that we print out is 2.
output example
Explanation / Answer
Hi below i have written a smaple example which show you to print 9 by 9 multiplication for your reference,Also i have written code for you to print any size you want for your understanding,
One more little change will allow a multiplecation table of any size:
/* Prints multiplication table in Java */Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.