Status: Not Started
- PiDay.java
Font Size
14
Parentheses autocomplete
Wrap lines
Editor
Theme
Code with blocks by default
Console Font Size
12
Console Theme
Display Server Graphics Screen
Show File Tab Bar
Debug Mode
8 Loop through all decimal places
PiDay.java
1
2
public class PiDay
{
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output
Grading
Docs
Exercise
More
History
Video
Download
About
Upload
W
Grader Results
x/x
Pass | Test | Message | |
---|---|---|---|
- | Test results will show here. | - |
Errors:
This student is viewing this assignment in English. View this page in English?
5 points
Now that we have a prototype for calculating the error at one particular decimal, we now want to calculate it for all of our decimal places from 0 to 15.
Start with your code from the previous exercise. You are then going to put this in a loop so that it prints out all of the circumferences and errors from 0 decimals to 15 decimals.
You are also going to add a line to print out how many decimal places are currently being used. You should also consider adding some line spacing between calculations.
Here is a sample output showing the calculations for 2 and 3 decimal places. You will go from 0 to 15:
**************
Number of decimals: 2
Current Circumference: 26454.5 miles
Difference: 13.41810649400577 miles
Percent Error: 0.050695738289720585%
**************
Number of decimals: 3
Current Circumference: 26471.35 miles
Difference: -3.4318935059927753 miles
Percent Error: -0.012966238947032055%
Note: Be sure to copy your code before moving on to the next exercise!
Reset Code
Upload an image
Upload from your computer
Or paste a link here
Slides and Notes
No slides available for this video
About
Java (main)
Java Version 1.8.0_222
Upload Media
File URL:
Your browser does not support recording media.
Please use up-to-date Chrome or Firefox in order to use audio and video recordings in your programs. Uploading files and taking photos should still work in your current browser.
Please use up-to-date Chrome or Firefox in order to use audio and video recordings in your programs. Uploading files and taking photos should still work in your current browser.