Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Styles Editing This programming task must be solved using Intelli). We will create an application that will hold data about the universe. It will largely

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Styles Editing This programming task must be solved using Intelli). We will create an application that will hold data about the universe. It will largely be a generalization, but we will create classes and create objects that reflect parts of this. Some data about our solar system that can be used in the thesis can be found here: solar_system_data.txt Download solar_system_data.txt (472 bytes) Solar System Data name, radius, mass, effectiveTemp Sun, 1.0, 1.0, 5777 name, radius, mass Mercury, 0.03412549655905556, 1.7297154899894627E-4 Venus, 0.08465003077267387, 0.002564278187565859 Earth, 0.08911486599899289, 0.003146469968387777 Mars, 0.04741089912158004, 3.3667017913593256E-4 Jupiter, 1.0, 1.0 Saturn, 0.8145247020645666, 0.2994204425731275 Uranus, 0.35475297935433336, 0.04573761854583773 Neptune, 0.34440217087026543, 0.05395152792413066 D Focus Voice e Replace 1 Normal 1 No Spac... Heading 1 Heading 2 Title Select Paragraph Styles Editing Exercise 1 We must be able to create planetary systems with associated data, we therefore need some classes to represent a planetary system. To begin with, we define that a planetary system should be able to have several planets, as well as one star. Therefore create 3 classes with instance variables: Planet name, radius, mass Star name, radius, mass, effective Temp PlanetSystem name, centerStar, planets The units in the data set for radius and mass will be explained in more detail in exercise 4. Select appropriate data types for the instance variables, as well as appropriate constructors for the classes Remember to make the instance variables private, and create get and set methods for these (encapsulation). Exercise 2 Create a class called Main.java that will use the classes you just created. Create an object of the PlanetSystem class for our own planetary system called "Solar system", with associated Planet objects and one Star object "Sun". Focus Styles Editing Voice Exercise 5 We want to be able to find surface Gravity (g) for a Planet, create a method that calculates and returns this based on the formula: Image result for surface gravity formula G = Gravity constant - 6.67408 x 10-11 m3 kg - 1.5-2 (6.67408E-11) ie approx. number: 0.0000000000667408 M = The mass of the planet (the formula uses kg here) R = Radius of the planet (the formula uses meters here) I Surface gravity on Saturn becomes 11.185248866725233 m/s2. What will be the surface gravity of Neptune? Use the method you created to print this in Main.java. Exercise 6 We want to be able to retrieve the largest and smallest planet in a PlanetSystem. The comparison must first be made based on the radius, if the radius is equal the mass must be compared. The methods (one for each) should return the planet. Create methods that do this, use these and print information about the planets in Main.java. Exercise 4: When we talk about data in the universe, we get large numbers when we use ordinary units. Astronomers often use units other than kg and km when we talk about mass and radius in the universe. They have therefore defined units that are related to larger objects in our own solar system. For planets you have the unit Jupiter Mass (Mjup or MJ) for mass, and Jupiter Radius (Rjup or RJ) for size. For stars, you have the unit Solar Mass (Msun or MO) for mass, and Solar Radius (Rsun or RO) for size. The dataset you have been given is in these units. The relationship for these is as follows: Astronomical Unit "ordinary" units 1 Mjup/M. 1.898x1027kg (1.898E27) 1 Rjup/R 71 492 km 1 Msun/M. 1.98892x10kg (1.98892E30) 1 Rsun / R 695 700 km Add a method that returns the radius in km for a Planet Add a method that returns mass in kg for a Planet. Add a method that returns the radius in km for a Star. Add a method that returns mass in kg for a Star. Venus will have a radius of 6051,8 km and a mass of 4,867E24 kg. What will be the radius in km and mass in kg for "Saturn"? What will be the radius in km and mass in kg and for our star "Sun"? Use the methods you have created to print this in Main.java

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions

Question

how would you have done things differently?

Answered: 1 week ago

Question

3. What information do participants need?

Answered: 1 week ago