Write a java program to help kids to learn the multiplication table. a) Define a method called multiplication that takes two numbers as parameters and returns their multiplication result. b) In the main method, write a java code that invokes the method created in a) to calculate and show the multiplication table for a number entered by the user. Ex: if the user enters 5 as number, your program should output the multiplication table of 5 as shown in the below sample run. c) In addition to the part b), your program should compute and display the sum of all the results of the multiplication table. Note: using methods is mandatory.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Write a java program to help kids to learn the multiplication table.
a) Define a method called multiplication that takes two numbers as parameters and returns their
multiplication result.
b) In the main method, write a java code that invokes the method created in a) to calculate and show
the multiplication table for a number entered by the user.
Ex: if the user enters 5 as number, your program should output the multiplication table of 5 as
shown in the below sample run.
c) In addition to the part b), your program should compute and display the sum of all the results of the
multiplication table.
Note: using methods is mandatory.
Sample Runs:
Enter a Number: 5
1 * 5 = 5
2 * 5 = 10
3* 5 = 15
4 * 5 = 20
5 * 5 =
25
6 * 5 = 30
7 * 5 = 35
8 * 5 = 40
95 45
10 5 50
The sum of all the results: 275
Enter a Number: 2
1 * 2 = 2
2 * 2 = 4
3 * 2 = 6
4*2 = 8
5 * 2 = 10
6 2 = 12
7*2 = 14
82 = 16
9 * 2 = 18
102
20
The sum of all the results: 110
Transcribed Image Text:Write a java program to help kids to learn the multiplication table. a) Define a method called multiplication that takes two numbers as parameters and returns their multiplication result. b) In the main method, write a java code that invokes the method created in a) to calculate and show the multiplication table for a number entered by the user. Ex: if the user enters 5 as number, your program should output the multiplication table of 5 as shown in the below sample run. c) In addition to the part b), your program should compute and display the sum of all the results of the multiplication table. Note: using methods is mandatory. Sample Runs: Enter a Number: 5 1 * 5 = 5 2 * 5 = 10 3* 5 = 15 4 * 5 = 20 5 * 5 = 25 6 * 5 = 30 7 * 5 = 35 8 * 5 = 40 95 45 10 5 50 The sum of all the results: 275 Enter a Number: 2 1 * 2 = 2 2 * 2 = 4 3 * 2 = 6 4*2 = 8 5 * 2 = 10 6 2 = 12 7*2 = 14 82 = 16 9 * 2 = 18 102 20 The sum of all the results: 110
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Returning value from Function
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education