Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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
expand button
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
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education