Given the following series: P(n)= 1-1/2+1/3-1/4+1/5...+1/n Write a java program that prints out the following table. It calculates and prints the value of P(n) for all odd integers <=35. Sample Run run: P(n) 1.000000 0.833333 0.783333 0.759524 0.745635 0.736544 0.730134 0.725372 0.721695 0.718771 0.716390 0.714414 0.712747 0.711323 0.710091 0.709016 0.708069 0.707229 BUILD SUCCESSFUL (total time: 0 seconds) 3 5 7 6. 11 13 15 17 19 21 23 25 27 29 31 33 35

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
Given the following series:
P(n)= 1-1/2+1/3-1/4+1/5...+1/n
Write a java program that prints out the following table. It calculates
and prints the value of P(n) for all odd integers <=35.
Sample Run
run:
P(n)
1.000000
0.833333
0.783333
0.759524
0.745635
0.736544
0.730134
0.725372
0.721695
0.718771
0.716390
0.714414
0.712747
0.711323
3
5
11
13
15
17
19
21
23
25
27
29
31
33
35
BUILD SUCCESSFUL (total time: @ seconds)
0.710091
0.709016
0.708069
0.707229
Transcribed Image Text:Given the following series: P(n)= 1-1/2+1/3-1/4+1/5...+1/n Write a java program that prints out the following table. It calculates and prints the value of P(n) for all odd integers <=35. Sample Run run: P(n) 1.000000 0.833333 0.783333 0.759524 0.745635 0.736544 0.730134 0.725372 0.721695 0.718771 0.716390 0.714414 0.712747 0.711323 3 5 11 13 15 17 19 21 23 25 27 29 31 33 35 BUILD SUCCESSFUL (total time: @ seconds) 0.710091 0.709016 0.708069 0.707229
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT