I'm trying to write a program in java that takes user input for the size of the sun in inches and outputs a table of solar system values based on the size of the sun given in inches. Camilla was asked by her niece, to help her with her project for the 7th grade Science Fair. She was overjoyed to have been asked to help. Her niece wanted to build a scale model of the solar system. Her niece, remembers having received a planisphere in 4th grade science class. But, she had lost it. But, she remembered that there were instructions on the planisphere for how to build a scale model of the solar system based on the Sun being the same size as the star circle. Her niece had always wanted to build that model and she thought that this would be the perfect Science Fair project. Camilla remembers having seen that planisphere. She and her niece guessed that the star circle in the planisphere was about 8 inches in diameter. Camilla was excited because she had always been interested in space. Her niece was excited too and wanted to get started right away. However, she had become a lawyer because technical things and math were never her academic strength. However, she remembered that you are studying computer science. So, she has come to you for help. Always looking for opportunities to serve, you accept the challenge and eagerly get right to work. First, you do some searches and find these values on the internet: Size - diameter (miles) distance from the sun (miles) Sun 870,000 Mercury 3,000 36,000,000 Venus 7,500 67,200,000 Earth 8,000 93,000,000 Mars 4,222 141,600,000 Jupiter 86,881 483,600,000 Saturn 75,000 886,700,000 Uranus 31,760 1,784,000,000 Neptune 30,775 2,794,400,000 Pluto (dwarf) 1,400 3,674,500,000 You decide that scientific notation is the best way to represent these values in a program. So, you create named CONSTANTS, initializing each of them to these values. Because there is some uncertainty about the scale model size of the sun, you decide to allow the user to enter their own value in inches. You know that you can find all of these scale sizes and distances, by setting up a ratio and solving for the unknown. Scale size of the Sun / actual size of the Sun = unknown scale size or distance / actual size or distance You set up the calculations and output the planet sizes in inches and the distances in inches, feet, yards and miles. Example output: This program will calculate the sizes and distances for a scale model of the solar system based on the user provided size of the sun in inches. For example, enter 8 for a solar system based on an 8 inch sun. Enter the size of the sun (in inches): 8 SCALE MODEL DIMENSIONS - sun: 8 inches diameter: distance: (inches) (inches) (feet) (yards) (miles) Mercury 0.0275862 331.034 27.5862 9.1954 0.00522466 Venus 0.0689655 617.931 51.4943 17.1648 0.0097527 Earth 0.0735632 855.172 71.2644 23.7548 0.013497 Mars 0.038823 1302.07 108.506 36.1686 0.0205503 Jupiter 0.798906 4446.9 370.575 123.525 0.0701846 Saturn 0.689655 8153.56 679.464 226.488 0.128686 Uranus 0.292046 16404.6 1367.05 455.683 0.258911 Neptune 0.282989 25695.6 2141.3 713.768 0.40555 Pluto (dwarf) 0.0128736 33788.5 2815.71 938.57 0.533278 Press any key to continue . . . Camilla and her niece were surprised at the size of the model. They had always seen the whole solar system condensed to a page in a textbook or a chart on the wall. So, she and her niece decided to use your program to see what size of Sun would create a model that could fit in the school gymnasium (100 foot long) where the Science Fair was being exhibited. But, that had some problems too. So she and her niece used your program again to see what size Sun would create a model that would fit in the school’s football field. But, that would require the judges to leave the exhibition area. What advice will you give to Camilla and her niece for actually building the model? So far, I assigned each vale to a double in my program. I can't seem to figure out where to go from here to get the sizes in each unit represented based on the user inches inputted. Here is the code I have so far:
I'm trying to write a
Camilla was asked by her niece, to help her with her project for the 7th grade Science Fair. She was overjoyed to have been asked to help.
Her niece wanted to build a scale model of the solar system. Her niece, remembers having received a planisphere in 4th grade science class. But, she had lost it. But, she remembered that there were instructions on the planisphere for how to build a scale model of the solar system based on the Sun being the same size as the star circle. Her niece had always wanted to build that model and she thought that this would be the perfect Science Fair project. Camilla remembers having seen that planisphere. She and her niece guessed that the star circle in the planisphere was about 8 inches in diameter.
Camilla was excited because she had always been interested in space. Her niece was excited too and wanted to get started right away. However, she had become a lawyer because technical things and math were never her academic strength.
However, she remembered that you are studying computer science. So, she has come to you for help. Always looking for opportunities to serve, you accept the challenge and eagerly get right to work.
First, you do some searches and find these values on the internet:
Size - diameter (miles) |
distance from the sun (miles) |
|
Sun |
870,000 |
|
Mercury |
3,000 |
36,000,000 |
Venus |
7,500 |
67,200,000 |
Earth |
8,000 |
93,000,000 |
Mars |
4,222 |
141,600,000 |
Jupiter |
86,881 |
483,600,000 |
Saturn |
75,000 |
886,700,000 |
Uranus |
31,760 |
1,784,000,000 |
Neptune |
30,775 |
2,794,400,000 |
Pluto (dwarf) |
1,400 |
3,674,500,000 |
You decide that scientific notation is the best way to represent these values in a program. So, you create named CONSTANTS, initializing each of them to these values.
Because there is some uncertainty about the scale model size of the sun, you decide to allow the user to enter their own value in inches.
You know that you can find all of these scale sizes and distances, by setting up a ratio and solving for the unknown.
Scale size of the Sun / actual size of the Sun = unknown scale size or distance / actual size or distance
You set up the calculations and output the planet sizes in inches and the distances in inches, feet, yards and miles.
Example output:
This program will calculate the sizes and distances for a scale model of the solar system based on the user provided size of the sun in inches.
For example, enter 8 for a solar system based on an 8 inch sun.
Enter the size of the sun (in inches): 8
SCALE MODEL DIMENSIONS - sun: 8 inches
diameter: distance:
(inches) (inches) (feet) (yards) (miles)
Mercury 0.0275862 331.034 27.5862 9.1954 0.00522466
Venus 0.0689655 617.931 51.4943 17.1648 0.0097527
Earth 0.0735632 855.172 71.2644 23.7548 0.013497
Mars 0.038823 1302.07 108.506 36.1686 0.0205503
Jupiter 0.798906 4446.9 370.575 123.525 0.0701846
Saturn 0.689655 8153.56 679.464 226.488 0.128686
Uranus 0.292046 16404.6 1367.05 455.683 0.258911
Neptune 0.282989 25695.6 2141.3 713.768 0.40555
Pluto (dwarf) 0.0128736 33788.5 2815.71 938.57 0.533278
Press any key to continue . . .
Camilla and her niece were surprised at the size of the model. They had always seen the whole solar system condensed to a page in a textbook or a chart on the wall. So, she and her niece decided to use your program to see what size of Sun would create a model that could fit in the school gymnasium (100 foot long) where the Science Fair was being exhibited. But, that had some problems too. So she and her niece used your program again to see what size Sun would create a model that would fit in the school’s football field. But, that would require the judges to leave the exhibition area.
What advice will you give to Camilla and her niece for actually building the model?
So far, I assigned each vale to a double in my program. I can't seem to figure out where to go from here to get the sizes in each unit represented based on the user inches inputted.
Here is the code I have so far:
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 3 images