program that accomplishes the same thing as the program in the pictures, except by using two dimensional arrays instead.
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fd6e87594-a0d7-48c0-af39-cad58e8108aa%2Faef450e4-42ce-4b9f-872e-8f95951cfc76%2Fild11d_processed.jpeg&w=3840&q=75)
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

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 1 images

Knowledge Booster
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.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education