program that accomplishes the same thing as the program in the pictures, except by using two dimensional arrays instead.

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 that accomplishes the same thing as the program in the pictures, except by using two dimensional arrays instead.
untitled3 src
C AdditionTable m main
CounterDemo.java X
© Bug java
x
C
Prog09.java x
AdditionTable.java x
Test1.java x
AdditionTable2.java x
C aritmetic.java x
© Counter.java x
untitled3 - 1
import java.util.Scanner;
> .idea
> out
2
3 ►
public class AdditionTable {
vsrc
4.
v Di i
com.c
public static void main(String[] args) {
Mai
6.
© test
G Additic
© Additic 8
aritme 9
C Bubble 10
© Bubble 11
int lowerBound; // Smallest number being added
int upperBound; // Largest number being added
Scanner input = new Scanner(System.in);
© Bug 12
Coin.je 13
e Compa 14
// Get the lower bound from the user
System.out.println("Enter the lower bound: ");
LowerBound = input.nextInt();
Counti
15
Counte
16
Earthq
17
C Elevati
// Get the upper bound from the user
System.out.println("Enter the upper bound: ");
Guess 18
G Hellop 19
G HiLo 28
C Inflatir 21
e Initials 22
© MathM
upperBound = input.nextInt();
// Print the header of the addition table
System.out.print ("+| ");
for (int row = lowerBound; row <= upperBound; row++) {
System.out.print (row + "| ");
23
e Middle 24
e PiggyE
25
e PriceD
26
e Progo!
27
G Sale
System.out.println("\n\n--1--|--|--|--|--|--|");
// Set the value of the row to the value of the lower bound
int row = lowerBound;
G sample 28
e Secret 29
e Secret 30
e Stamp 31
e Testi 32
G Tiles 33
// While loop that runs until the value of row is less than or equal
// to the upper bound
while (row <= upperBound){
e Vendir
34
e Volumi
35
G Volum
36
untitled3.
37
// Calculate the additions and print them to the screen
System.out.print("\n" + row + "I ");
for (int column = LowerBound; column <= upperBound; column++) {
> Il External Libi
Scratches at
38
System.out.print(row + column + "| ");
39
48
System.out.println("\n\n--|--|--|--|--|--|--|");
row++; // Increment the volue of the row
41
42
* Run:
AdditionTablex
Run E TODO
O Build completed successfully in 2 sec, 724 ms (3 minutes ago)
O Problems
Terminal
K Build
MacBook Pro
O AdditionTab >
esc
!
@
2#
$
%
&
1
2
4
6
8
Transcribed Image Text:untitled3 src C AdditionTable m main CounterDemo.java X © Bug java x C Prog09.java x AdditionTable.java x Test1.java x AdditionTable2.java x C aritmetic.java x © Counter.java x untitled3 - 1 import java.util.Scanner; > .idea > out 2 3 ► public class AdditionTable { vsrc 4. v Di i com.c public static void main(String[] args) { Mai 6. © test G Additic © Additic 8 aritme 9 C Bubble 10 © Bubble 11 int lowerBound; // Smallest number being added int upperBound; // Largest number being added Scanner input = new Scanner(System.in); © Bug 12 Coin.je 13 e Compa 14 // Get the lower bound from the user System.out.println("Enter the lower bound: "); LowerBound = input.nextInt(); Counti 15 Counte 16 Earthq 17 C Elevati // Get the upper bound from the user System.out.println("Enter the upper bound: "); Guess 18 G Hellop 19 G HiLo 28 C Inflatir 21 e Initials 22 © MathM upperBound = input.nextInt(); // Print the header of the addition table System.out.print ("+| "); for (int row = lowerBound; row <= upperBound; row++) { System.out.print (row + "| "); 23 e Middle 24 e PiggyE 25 e PriceD 26 e Progo! 27 G Sale System.out.println("\n\n--1--|--|--|--|--|--|"); // Set the value of the row to the value of the lower bound int row = lowerBound; G sample 28 e Secret 29 e Secret 30 e Stamp 31 e Testi 32 G Tiles 33 // While loop that runs until the value of row is less than or equal // to the upper bound while (row <= upperBound){ e Vendir 34 e Volumi 35 G Volum 36 untitled3. 37 // Calculate the additions and print them to the screen System.out.print("\n" + row + "I "); for (int column = LowerBound; column <= upperBound; column++) { > Il External Libi Scratches at 38 System.out.print(row + column + "| "); 39 48 System.out.println("\n\n--|--|--|--|--|--|--|"); row++; // Increment the volue of the row 41 42 * Run: AdditionTablex Run E TODO O Build completed successfully in 2 sec, 724 ms (3 minutes ago) O Problems Terminal K Build MacBook Pro O AdditionTab > esc ! @ 2# $ % & 1 2 4 6 8
IntelliJ IDEA
File
Edit View
Navigate
Code
Refactor
Build
Run Tools
VCS
Window
Help
Ru
Run:
AdditionTable x
ZUsers/jacobiohnston/Library/Java/JavaVirtualMachines/openidk-16.0.2/Contents/Home/bin/java -javaage
Enter the lower bound:
-3
Enter the upper bound:
2
%3D
+| -3| -2| -1| 0| 1| 2|
--|--|--|--|--|--|--|
-3| -6| -5| -4| -3| -2| -1|
--|--|--|--|--|--|--|
-2| -5| -4| -3| -2| -1| 0|
--|--|--|--|--|--|--|
-1| -4| -3| -2| -1| 0| 1|
--|--|--|--|--|--|--|
e| -3| -2| -1l el 1 21
--|--|--|--|--|--|--|
11-21-11 이 11 21 31
--|--|--|--|--|--|--|
2| -1| 0| 1| 2| 31 41
--|--|--|--|--|--|--|
Process finished with exit code 0
699
NOV
29
MacBook Pr
esc
Transcribed Image Text:IntelliJ IDEA File Edit View Navigate Code Refactor Build Run Tools VCS Window Help Ru Run: AdditionTable x ZUsers/jacobiohnston/Library/Java/JavaVirtualMachines/openidk-16.0.2/Contents/Home/bin/java -javaage Enter the lower bound: -3 Enter the upper bound: 2 %3D +| -3| -2| -1| 0| 1| 2| --|--|--|--|--|--|--| -3| -6| -5| -4| -3| -2| -1| --|--|--|--|--|--|--| -2| -5| -4| -3| -2| -1| 0| --|--|--|--|--|--|--| -1| -4| -3| -2| -1| 0| 1| --|--|--|--|--|--|--| e| -3| -2| -1l el 1 21 --|--|--|--|--|--|--| 11-21-11 이 11 21 31 --|--|--|--|--|--|--| 2| -1| 0| 1| 2| 31 41 --|--|--|--|--|--|--| Process finished with exit code 0 699 NOV 29 MacBook Pr esc
Expert Solution
steps

Step by step

Solved in 3 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
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