The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 4 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Hi, I have a project for CISS 110 that I need some help. I will submit this tomorrow. I attached the specifics. Thank you.
This project deals with a range-based for loop where we know the exact number of
times a loop will iterate (perform the associated block of code). You will also use
an if/else construct to determine if work will be done based on the values entered by
the user. In addition, we are using the static methods from the Math class,
namely pow() and sqrt().
Given:
int x, lowerBound, upperBound;
double square, squareRoot; Have the user enter a lower bound and an upper bound for a range of integers.
If lowerBound is greater than the upperBound, inform the user that no work will be
performed otherwise you will construct a for loop to process the range of values from
the lower bound to the upper bound, inclusive, incrementing by one each time.
Each time through the loop, using the pow() and sqrt() static Math methods, calculate
the square and square root of each value and store the result in the appropriate
variable. Display your results. All results involving precision should be to two decimal
places using the printf() method of System.out.