TableAA.java Write a program that will store a multiplication table in a 2-D array. The user will enter how many lines (rows) it will have. The table will be printed to the screen. (Make it look nice – consider using printf.) This program will contain a static method. This method will take in an integer (the user’s number) and it will return a 2-D array. The code inside of the method will create the array, fill it with all the appropriate values that one would expect in a multiplication table, and then return that filled array. In the main method, you will ask the user how many lines they want to see and then you will use your static method to get the array. Once you have the array back from the static method, use nested for loops to print it in table form. See samples on the following pages. Program only needs to run once. Add try/catches so the user can only enter positive integers (1 and higher).

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

TableAA.java

Write a program that will store a multiplication table in a 2-D array. The user will enter how many lines (rows) it will have. The table will be printed to the screen. (Make it look nice – consider using printf.)

This program will contain a static method. This method will take in an integer (the user’s number) and it will return a 2-D array. The code inside of the method will create the array, fill it with all the appropriate values that one would expect in a multiplication table, and then return that filled array.

In the main method, you will ask the user how many lines they want to see and then you will use your static method to get the array. Once you have the array back from the static method, use nested for loops to print it in table form. See samples on the following pages. Program only needs to run once. Add try/catches so the user can only enter positive integers (1 and higher).

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning