1. Write a java program that asks the user to input two integers intStart and intEnd then computes the below series for all the numbers between those integers inclusive. intStart should be smaller than intEnd. intStart /n+ (intStart+1)/n+ (intStart+2)/n+.... intEnd/n Your program should calculate this series for n-5, 10, 15... 50, exactly as the below sample run Enter Start and End values: 5 10 For n 5.0 The sum is: 9.0 The sum is: 4.5 For n 10.0 For n 15.0 The sum is: 3.0 For n 20.0 The sum is: 2.25 For n 25.0 The sum is: 1.79 The sum is: 1.5 For n 30.0 For n 35.0 The sum is: 1.28 For n 40.0 The sum is: 1.12 For n 45.0 The sum is: 1.0 For n 50.0 The sum is: 0.89 Enter Start and End Values: 10 5 Start should be smaller than End

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
1- Write a java program that asks the user to input two integers intStart and intEnd then computes the below
series for all the numbers between those integers inclusive. intStart should be smaller than intEnd.
intStart /n+ (intStart+1)/n+ (intStart+2)/n+....intEnd/n
Your program should calculate this series for n-5, 10, 15 ... 50, exactly as the below sample run
Enter Start and End values: 5 10
For n
5.0
The sum is: 9.0
For n
10.0
The sum is: 4.5
For n
15.0
The sun is: 3.0
For
= 28.0
For n = 25.0
For n 30.0
For n= 35.0
For n = 40.0
For n 45.0
For n 50.0
The sum is: 2.25
The sum is: 1.79
The sum is: 1.5
The sum is: 1.28.
The sum is: 1.12.
The sum is: 1.0
The sum is: 0.89
Enter Start and End Values: 105
Start should be smaller than End
Transcribed Image Text:1- Write a java program that asks the user to input two integers intStart and intEnd then computes the below series for all the numbers between those integers inclusive. intStart should be smaller than intEnd. intStart /n+ (intStart+1)/n+ (intStart+2)/n+....intEnd/n Your program should calculate this series for n-5, 10, 15 ... 50, exactly as the below sample run Enter Start and End values: 5 10 For n 5.0 The sum is: 9.0 For n 10.0 The sum is: 4.5 For n 15.0 The sun is: 3.0 For = 28.0 For n = 25.0 For n 30.0 For n= 35.0 For n = 40.0 For n 45.0 For n 50.0 The sum is: 2.25 The sum is: 1.79 The sum is: 1.5 The sum is: 1.28. The sum is: 1.12. The sum is: 1.0 The sum is: 0.89 Enter Start and End Values: 105 Start should be smaller than End
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning