Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***Need to create the code using Java to have the following output of the Multiplication table while following the criteria and requirements listed below. All

***Need to create the code using Java to have the following output of the Multiplication table while following the criteria and requirements listed below. All the steps/requirements are listed as well.

**Screenshot of the Output**

image text in transcribed

Instructions

Use only what you have learned in Chapter 1 and Chapter 2 (print, println, methods, tabs, for loops, and nested for loops, etc.). Please use the Instructor Video: Chapter 2.3-2.4 Java Code Example and Powerpoint resources for Chapter 2 located in iCollege.

NOTE: PLEASE READ ALL OF THE INSTRUCTIONS BELOW BEFORE STARTING YOUR PROGRAM. You should not have any code or methods in your program that are not required below.

Write a java program that produces the following output using for loops and nested for loops. The output should look exactly like the Sample Output below:

 

image text in transcribed

1. Name the class file Multiplication.java

2. Use methods to avoid redundancy. In addition to the main method, you should have 4 additional methods that output the 4 distinct parts above (greeting, table header, multiplication table, goodbye message). Explanations are below.

  • greetUser()
  • drawHeader()
  • fillTable()
  • goodbyeMessage()

3. greetUser method: Output the Welcome message shown in the sample output - formatted as shown. Remember to callthis method from main.

4. drawHeader method: Use a for loop to output the "header row" of numbers of the multiplication table. It should print the numbers 1 - 9. It should look exactly like the output, so you may need to use tabs or spaces. This method should also have a "dashed border" above and below the numbers. Remember to call this method from main.

5. fillTable method: Use a nested for loop to fill in the multiplication table with the correct values using your for loop variables (i.e i and j)- (i.e. 7 x 8 = 56, etc). Remember the "outer" for loop is the row and the "inner" for loop is the columns. You will need to use tabs and/or spaces to make it look like the sample output. ** You will put the columnheading in the for loop in this method as well (the vertical 1 - 9 and '|' out front). Remember to call this method from main.

6. goodbyeMessage method: Output the goodbye message shown in the sample output. Use tabs/spaces to match the sample output. Remember to call this method from main.

7. Once your code is working, create a Java CONSTANT variable called TABLE_COUNT and set it equal to 9. This goes abovethe main method after the class opening. In all of your for loops using 9, replace the '9' with the TABLE_COUNT constant. Compile and run program again to ensure it is still working correctly.

8. Remember to use good Java programming practices such as commenting classes and methods. Please see Coding Guidelines and Rubric for more information.

EX:

Program:

/** * This class put your description here * * @author YourNameHere * @version Today'sDateHere * */

Methods:

Single-line comments:

// This method put description here

Multi-line comments:

/** * This method put your description here */

Welcome to the Multiplication Table Application 2 246 8 10 12 14 16 18 3 3 69 12 15 18 21 24 27 4 1 4 812 16 20 24 28 32 36 5 1 510 15 20 25 30 35 40 45 6 1612 18 24 30 36 4248 54 7 1 7 1421 28 35 424956 63 88162432 40 4856 64 72 919 18 27 36 45 54 63 72 81 Goodbye and thank you for using the multiplication application

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions