Please check the report summary example below & provide the application source code,  console output and the report file: Place the following parallel arrays as globals in your program class (before the main() ). static String[] planetname ={"Earth","Mercury","Jupiter","Mars","Saturn","Uranus","Neptune","Pluto","Venus", }; // diameter in kilometres :  static int[] diamKM ={  12760, 4878, 139822,          6787,120500, 51120, 49530, 2301, 12104, }; // orbit time (in Earth years) :   static double[] orbYR ={ 0.241, 0.616, 1.0, 1.88, 11.9, 29.5, 84.0, 165.0, 248.0 }; In the main(), Step 1: convert from orbit in years to orbit in days, 1. declare a new int array orbDays[ ] using the length of orbYR[ ] array 2. populate the new array with the values of the orbYR[ ] array converted to days, - orbit in days = (orbit in years * 365) Step 2: use the orbDays[ ] array and planetname[ ] (name) array, 1. planet with minimum orbit, determine: minOrb and nameMinOrb 2. planet with maximum orbit, determine: maxOrb and nameMaxOrb Step 3: using the outcomes from the above, generate a summary report (send to a report file) 1. display the orbit in days; ex: Venus orbit is 224 days, Earth orbit is 365 days 2. planet name is shown in UPPERCASE 3. diameter is shown in x/1000’s of kms in format 4.2f (2 decimal places); ex: Mercury’s diam (4878 kms) is 4.88 4. the report is displayed on the console, and sent to a file (planetreport.txt)  5. use a common output string, which contains the output, to easily send to console and report file 6. use Exam.writeStringToFile("planets.txt") to send the report to the file.   This is how the summary report should look: The summary report format: Planet            Diam(1000kms)               Orbit(days)          ----------------------------------------------------------- EARTH            12.77                                  365 MERCURY       4.88                                    87                                                    . . .                                                                                                                         VENUS          12.10                                   224 ----------------------------------------------------------- Min. orbit: 87 days Mercury Max. orbit: 90520 days Pluto

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please check the report summary example below & provide the application source code,  console output and the report file:

Place the following parallel arrays as globals in your program class (before the main() ).

static String[] planetname ={"Earth","Mercury","Jupiter","Mars","Saturn","Uranus","Neptune","Pluto","Venus", };

// diameter in kilometres :  static int[] diamKM ={  12760, 4878, 139822,          6787,120500, 51120, 49530, 2301, 12104, };

// orbit time (in Earth years) :   static double[] orbYR ={ 0.241, 0.616, 1.0, 1.88, 11.9, 29.5, 84.0, 165.0, 248.0 };

In the main(),

Step 1: convert from orbit in years to orbit in days,

1. declare a new int array orbDays[ ] using the length of orbYR[ ] array

2. populate the new array with the values of the orbYR[ ] array converted to days,

- orbit in days = (orbit in years * 365)

Step 2: use the orbDays[ ] array and planetname[ ] (name) array,

1. planet with minimum orbit, determine: minOrb and nameMinOrb

2. planet with maximum orbit, determine: maxOrb and nameMaxOrb


Step 3: using the outcomes from the above, generate a summary report (send to a report file)

1. display the orbit in days; ex: Venus orbit is 224 days, Earth orbit is 365 days

2. planet name is shown in UPPERCASE

3. diameter is shown in x/1000’s of kms in format 4.2f (2 decimal places); ex: Mercury’s diam (4878 kms) is 4.88

4. the report is displayed on the console, and sent to a file (planetreport.txt) 

5. use a common output string, which contains the output, to easily send to console and report file

6. use Exam.writeStringToFile("planets.txt") to send the report to the file.

 

This is how the summary report should look:

The summary report format:

Planet            Diam(1000kms)               Orbit(days)         

-----------------------------------------------------------

EARTH            12.77                                  365

MERCURY       4.88                                    87                                                    .

.

.                                                                                                                         VENUS          12.10                                   224

-----------------------------------------------------------

Min. orbit: 87 days Mercury

Max. orbit: 90520 days Pluto

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Passing Array as Argument
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education