In this python program convert into java program and run show the picture of the output of the program. Thank you. Source Code: import math import decimal           def ln(x,y):     lnX = math.log(x)     lnY = math.log(y)     ln = lnX + lnY *2     return ln lower_limit = float(input("Enter lower limit: ")) upper_limit = float(input("Enter upper limit: ")) iterations = (upper_limit -1)/0.05 iterations = int(iterations) y = 1.05 final_answer = 0 for i in range(1, iterations):     ans = ln(lower_limit, y)     lower_limit += 0.05     y = lower_limit + 0.05     final_answer += ans     x = round(lower_limit,2)     x = decimal.Decimal(x)     y = decimal.Decimal(y)     x = round(x,2)     y = round(y,2)     print("_________________________________________________________________________________________________________________")     print("Iteration:",round(x,2))     print("Function\\|\Lower Limit \|\ Upper Limit \|\ Trapezoid Application (width=0.05) \|")     print("(ln(x)+ln(x)/2)1 \|\x=",round(x,2),"\|\x=",round(y,2),"\|\ (ln(",x,")+ln(",y,")/2)1\|\\Answer: ",ans) print("______________________________________________________________________________________________________________________") print("\\Total Iterations:",round(x,2))           print ("Final Answer/Summation of all iterations:",final_answer)     .. See the picture below that's an output of this program. Thank you

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

In this python program convert into java program and run show the picture of the output of the program. Thank you.

Source Code:

import math

import decimal          

def ln(x,y):
    lnX = math.log(x)
    lnY = math.log(y)
    ln = lnX + lnY *2
    return ln

lower_limit = float(input("Enter lower limit: "))
upper_limit = float(input("Enter upper limit: "))

iterations = (upper_limit -1)/0.05
iterations = int(iterations)
y = 1.05
final_answer = 0
for i in range(1, iterations):
    ans = ln(lower_limit, y)
    lower_limit += 0.05
    y = lower_limit + 0.05
    final_answer += ans
    x = round(lower_limit,2)
    x = decimal.Decimal(x)
    y = decimal.Decimal(y)
    x = round(x,2)
    y = round(y,2)

    print("_________________________________________________________________________________________________________________")
    print("Iteration:",round(x,2))
    print("Function\\|\Lower Limit \|\ Upper Limit \|\ Trapezoid Application (width=0.05) \|")
    print("(ln(x)+ln(x)/2)1 \|\x=",round(x,2),"\|\x=",round(y,2),"\|\ (ln(",x,")+ln(",y,")/2)1\|\\Answer: ",ans)
print("______________________________________________________________________________________________________________________")
print("\\Total Iterations:",round(x,2))          
print ("Final Answer/Summation of all iterations:",final_answer)
 
 
..
See the picture below that's an output of this program. Thank you
IDLE Shell 3.10.0
Eile
Edit
Shell
Debug
Options
Window
Help
RESTART:
D:/Program Files
(x86) /python/2.py
=====
Enter
lower limit:
Enter upper
limit:
Iterat ion:
Functi on
(In (x) +ln (x) /2)1
1.05
Trapezoid Application
(In (
Lower Limit
Upper Limit
(width=0.05)
1.05
x= 1.10
1.05
) +ln ( 1.10 )/2)1
x=
Answer:
O.0975 8032833886408
Iterat ion:
1.10
Trapezoid Application
(In ( 1.10 )+ln ( 1.15 )/2)1
Function
Lower Limit
Upper Limit
(width=0.05)
(ln (x) ++ln (x) /2)1
x= 1.10
x= 1.15
Answer:
0.23941052377 808192
Iterat ion:
1.15
Trapezoid Application
(in ( 1.15 ) +ln ( 1.20 )/2)1
Function
Lower Limit
Upper Limit
(width=o.05)
(in (x) +ln (x)/2)1
x= 1.15
x= 1.20
Answer:
0.3748340645546422
Iteration: 1.20
Trapezoid Application
(in ( 1.20 ) +ln ( 1.25 )/2) 1
Function
Lower Limit
Upper Limit
(width= o.05)
(in (x) +ln (x)/2)1
x= 1.20
x= 1.25
Answer:
0.504405055963068
Iterat ion:
1.25
Trapezoid Application
(In ( 1.25
Function
Lower Limit
Upper Limit
(width=o.05)
(in (x) +ln (x) /2)1
1.25
1.30
) +ln ( 1.30 )/2)1
Answer:
0.6286086594223743
Iterat ion:
Functi on
(in (x) +ln (x) /2)1
1.30
Trapezoid Application
(ln ( 1. 30 ) +ln ( 1.35 )/2)1
Lower Limit
Upper Limit
(width=o.05)
x= 1.30
x= 1.35
Answer:
0.747872080249192
Iteration:
1.35
Functi on
(in (x) +ln (x) /2)1
Trapezoid Application
(in (
Lower Limit
Upper Limit
(width=o.05)
x= 1.35
1.40
1.35 ) +ln (
1.40
)/2)1
Ln: 492
Col: 0
IDLE Shell 3.10.0
Edit
Iterat ion:
Functi on
(in (x) +ln (x) /2)1
File
Shell
Debug
Options
Window
Help
1.35
Trapezoid Application
(in ( 1.35 ) +ln ( 1.40 )/2)1
Lower Limit
Upper Limit
(width=o.05)
x= 1.35
x= 1.40
Answer:
0.8625734493681676
Iterat ion:
1.40
Trapezo id Application
(in ( 1. 40 ) +ln ( 1.45 )/2)1
Function
Lower Limit
Upper Limit
(width=o.05)
(In (x) +ln (x)/2)1
1.40
x= 1.45
Answer:
0.9730490656927642
Iterat ion:
1.45
Trapezoid Application
(in ( 1.45 ) +1n ( 1.50 )/2)1
Function
Lower Limit
Upper Limit
(width=o.05)
(In (x) +ln (x) /2)1
x= 1.45
x= 1.50
Answer :
1.079599349486179
Iterat ion:
1.50
Trapezoid Application
(In ( 1. 50 ) +ln ( 1.55 )/2)1
Function
Lower Limit
Upper Limit
(width= o.05)
(in (x) +ln (x)/2)1
x= 1.50
X= 1.55
Answer:
1.182493772648812
Iterat ion:
1.55
Trapezoid Application
(In ( 1.55 ) +ln ( 1.60 )/2)1
Function
Lower Limit
Upper Limit
(width=o.05)
(in (x) +ln (x)/2)1
1.55
x= 1.60
Answer:
1.2819749699704752
Iterat ion:
Functi on
(in (x) +ln (x) /2) 1
1.60
Trapezoid Application
(In ( 1.60 ) +ln ( 1.65 )/2)1
Lower Limit
Upper Limit
(width= o.05)
1.60
x= 1.65
Answer:
1.3782621894226268
Iteration:
1.65
Trapezoid Application
(In ( 1. 65 ) +ln ( 1.70 )/2) 1
Function
Lower Limit
Upper Limit
(width=o.05)
(In (x) +ln (x)/2)1
1.65
x= 1.70
Answer:
1.4715542050707142
Iterat ion:
Functi on
1.70
Lower
Limit
Upper Limit
Trapezoid Application
(width=o.05)
Ln: 492
Col: 0
IDLE Shell 3.10.0
File
Edit
Shell
Debug Options
Window
Help
Answer:
1.4715542050707142
Iteration: 1.70
Function
Lower L imit
Upper Limit
Trapezoid Application
(width=0.05)
(In (x) +ln (x)/2) 1
x= 1.70
x= 1.75
(In ( 1.70 )+1n ( 1.75 )/2) 1
Answer:
1.5620317900368303
Iteration: 1.75
Function
Lower Limit
Upper Limit
Trapezoid Application (width-0.05)
(In (x) +ln (x)/2) 1
x= 1.75
x= 1.80
(In ( 1.75 )+ln ( 1.80 )/2) 1
Answer:
1.649859826933016
Iteration: 1.80
Function
Lower Limit
Upper Limit
Trapezoid Application (width=0.05)
(In (x) +ln (x) /2)1
1.80
x= 1.85
(In ( 1.8O )+1n ( 1.85 )/2)1
Answer:
1.7351891177396612
Iteration:
1.85
Function
Lower Limit
Upper Limit
Trapezoid Application (width=0.05)
(In (x) +ln (x) /2) l
x= 1.85
x= 1.9O
(In ( 1.85 ) +ln ( 1.90 )/2)1
Answer:
1.8181579430825865
Iteration:
1.90
Function
Lower Limit
Upper Limit
Trapezoid Application
(width=0.05)
(In (x) +ln (x)/2) 1
x= 1.90
x= 1.95
(ln ( 1.90 ) +ln ( 1.95 )/2) 1
Answer:
1.898893411435023
Iteration:
1.95
Trapezoid Application
(In ( 1.95 )+1n ( 2.00 )/2)1
Function
Lower Limit
Upper Limit
(width-0.05)
(In (x) +ln (x) /2) 1
1.95
x= 2.0O
Answer:
1.9775126313237061
Total Iterations:
1.95
Final Answer/Summation of all iterations:
21.46386243451678
>>>
Ln: 492
Col: 0
Transcribed Image Text:IDLE Shell 3.10.0 Eile Edit Shell Debug Options Window Help RESTART: D:/Program Files (x86) /python/2.py ===== Enter lower limit: Enter upper limit: Iterat ion: Functi on (In (x) +ln (x) /2)1 1.05 Trapezoid Application (In ( Lower Limit Upper Limit (width=0.05) 1.05 x= 1.10 1.05 ) +ln ( 1.10 )/2)1 x= Answer: O.0975 8032833886408 Iterat ion: 1.10 Trapezoid Application (In ( 1.10 )+ln ( 1.15 )/2)1 Function Lower Limit Upper Limit (width=0.05) (ln (x) ++ln (x) /2)1 x= 1.10 x= 1.15 Answer: 0.23941052377 808192 Iterat ion: 1.15 Trapezoid Application (in ( 1.15 ) +ln ( 1.20 )/2)1 Function Lower Limit Upper Limit (width=o.05) (in (x) +ln (x)/2)1 x= 1.15 x= 1.20 Answer: 0.3748340645546422 Iteration: 1.20 Trapezoid Application (in ( 1.20 ) +ln ( 1.25 )/2) 1 Function Lower Limit Upper Limit (width= o.05) (in (x) +ln (x)/2)1 x= 1.20 x= 1.25 Answer: 0.504405055963068 Iterat ion: 1.25 Trapezoid Application (In ( 1.25 Function Lower Limit Upper Limit (width=o.05) (in (x) +ln (x) /2)1 1.25 1.30 ) +ln ( 1.30 )/2)1 Answer: 0.6286086594223743 Iterat ion: Functi on (in (x) +ln (x) /2)1 1.30 Trapezoid Application (ln ( 1. 30 ) +ln ( 1.35 )/2)1 Lower Limit Upper Limit (width=o.05) x= 1.30 x= 1.35 Answer: 0.747872080249192 Iteration: 1.35 Functi on (in (x) +ln (x) /2)1 Trapezoid Application (in ( Lower Limit Upper Limit (width=o.05) x= 1.35 1.40 1.35 ) +ln ( 1.40 )/2)1 Ln: 492 Col: 0 IDLE Shell 3.10.0 Edit Iterat ion: Functi on (in (x) +ln (x) /2)1 File Shell Debug Options Window Help 1.35 Trapezoid Application (in ( 1.35 ) +ln ( 1.40 )/2)1 Lower Limit Upper Limit (width=o.05) x= 1.35 x= 1.40 Answer: 0.8625734493681676 Iterat ion: 1.40 Trapezo id Application (in ( 1. 40 ) +ln ( 1.45 )/2)1 Function Lower Limit Upper Limit (width=o.05) (In (x) +ln (x)/2)1 1.40 x= 1.45 Answer: 0.9730490656927642 Iterat ion: 1.45 Trapezoid Application (in ( 1.45 ) +1n ( 1.50 )/2)1 Function Lower Limit Upper Limit (width=o.05) (In (x) +ln (x) /2)1 x= 1.45 x= 1.50 Answer : 1.079599349486179 Iterat ion: 1.50 Trapezoid Application (In ( 1. 50 ) +ln ( 1.55 )/2)1 Function Lower Limit Upper Limit (width= o.05) (in (x) +ln (x)/2)1 x= 1.50 X= 1.55 Answer: 1.182493772648812 Iterat ion: 1.55 Trapezoid Application (In ( 1.55 ) +ln ( 1.60 )/2)1 Function Lower Limit Upper Limit (width=o.05) (in (x) +ln (x)/2)1 1.55 x= 1.60 Answer: 1.2819749699704752 Iterat ion: Functi on (in (x) +ln (x) /2) 1 1.60 Trapezoid Application (In ( 1.60 ) +ln ( 1.65 )/2)1 Lower Limit Upper Limit (width= o.05) 1.60 x= 1.65 Answer: 1.3782621894226268 Iteration: 1.65 Trapezoid Application (In ( 1. 65 ) +ln ( 1.70 )/2) 1 Function Lower Limit Upper Limit (width=o.05) (In (x) +ln (x)/2)1 1.65 x= 1.70 Answer: 1.4715542050707142 Iterat ion: Functi on 1.70 Lower Limit Upper Limit Trapezoid Application (width=o.05) Ln: 492 Col: 0 IDLE Shell 3.10.0 File Edit Shell Debug Options Window Help Answer: 1.4715542050707142 Iteration: 1.70 Function Lower L imit Upper Limit Trapezoid Application (width=0.05) (In (x) +ln (x)/2) 1 x= 1.70 x= 1.75 (In ( 1.70 )+1n ( 1.75 )/2) 1 Answer: 1.5620317900368303 Iteration: 1.75 Function Lower Limit Upper Limit Trapezoid Application (width-0.05) (In (x) +ln (x)/2) 1 x= 1.75 x= 1.80 (In ( 1.75 )+ln ( 1.80 )/2) 1 Answer: 1.649859826933016 Iteration: 1.80 Function Lower Limit Upper Limit Trapezoid Application (width=0.05) (In (x) +ln (x) /2)1 1.80 x= 1.85 (In ( 1.8O )+1n ( 1.85 )/2)1 Answer: 1.7351891177396612 Iteration: 1.85 Function Lower Limit Upper Limit Trapezoid Application (width=0.05) (In (x) +ln (x) /2) l x= 1.85 x= 1.9O (In ( 1.85 ) +ln ( 1.90 )/2)1 Answer: 1.8181579430825865 Iteration: 1.90 Function Lower Limit Upper Limit Trapezoid Application (width=0.05) (In (x) +ln (x)/2) 1 x= 1.90 x= 1.95 (ln ( 1.90 ) +ln ( 1.95 )/2) 1 Answer: 1.898893411435023 Iteration: 1.95 Trapezoid Application (In ( 1.95 )+1n ( 2.00 )/2)1 Function Lower Limit Upper Limit (width-0.05) (In (x) +ln (x) /2) 1 1.95 x= 2.0O Answer: 1.9775126313237061 Total Iterations: 1.95 Final Answer/Summation of all iterations: 21.46386243451678 >>> Ln: 492 Col: 0
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Random Class and its operations
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