java program due to your outstanding performance in the fall of 2016 nasa jpl the na 5196095

Java Program

Due to your outstanding performance in the Fall of 2016, NASA-JPL (The National Aeronautics and Space Administration – Jet Propulsion Laboratory) has hired you as an intern. Your job will be to write a program to display and analyze data from the recent New Horizons space probe Pluto flyby. There are two main deliverables for your program:

1.      A visual representation of a section of the planet surface, drawn with characters.

a.       An asterisk * represents an area of the planet surface.

b.      A period . represents an area of the planet atmosphere.

2.      Calculate and print the following statistics about the planet surface section:

a.       Lowest point on the planet surface.

b.      Highest point on the planet surface.

c.       Average height of the planet surface.

Your program will take user input which represents a small section of the planet surface as seen from the space probe (Due to budget cuts at NASA, the data will be manually entered by the intern, i.e. you). Input will consist of:

1.     Number of data points (integer)

2.     Array of int data representing surface height (km) of the planet at each point

You may assume that the number of data points will be 20 or less, and that each number will be less than 100. You may also assume that the user will enter only positive integers for the data points. No validation is required for the user input.

Details

Your program will print a simple visual display of the data, followed by some statistical information gathered from it. The specific items you must calculate are:

1.      Lowest surface point – The array element with the smallest value.

·        Ex: Lowest surface point of [1, 2, 3, 4, 5, 6] would be 1.

2.      Highest surface point – The array element with the largest value.

·        Ex: Highest surface point of [1, 2, 3, 4, 5, 6] would be 6.

3.      Average surface height – Average value of all the surface heights in the array.

·        Ex: Average surface height of [1, 2, 3, 4, 5, 6] would be 21/6 = 3.5

Your display must be scaled to the highest point in the data. In other words, you will only create a graph that is as large as necessary based on your data. For example, a data set of [1, 2, 4, 3, 1] would produce the following graph:

. . * . .

. . * * .

. * * * .

* * * * *

Sample user input/output (Note: Bold items are user input, and there is an extra space after each period . and asterisk *):

*** Planetary Data Analyzer ***

Enter the number of data points: 13

* * * * * * * * * * * * *

Lowest surface point    : 1km

Enter data points: 1 2 4 5 3 3 4 5 4 5 6 7 9

. . . . . . . . . . . . *

. . . . . . . . . . . . *

. . . . . . . . . . . * *

. . . . . . . . . . * * *

. . . * . . . * . * * * *

. . * * . . * * * * * * *

. . * * * * * * * * * * *

. * * * * * * * * * * * *

Highest surface point   : 9km

Average surface height : 4.461538461538462km

Requirements

Static Variables: You MAY NOT use static variables in this program (variables that have they keyword ‘static’). All variables must either be created in your methods, or passed to other methods as parameters. Failure to follow this rule will result in a zero for the assignment. Note that your methods may (and in fact must) be static – just not your variables. The purpose of this assignment is to reinforce the concept of methods and parameters. Static variables allow people to bypass this objective (and in fact are almost always a bad idea in programming in general for reasons we will learn soon).

Ex: public static int myMethod(int[] data) { … } OK

Ex: public static int someNumber = 0;                  NOT OK

Methods: Your program must contain at least 5 methods in all (main method + 4 others). It may contain more if you wish. Each statistic must be calculated and returned as a value by a separate method. The visualization print-out must be done by a separate method. Main method + 3 statistic methods + 1 visualization method = 5 methods. These methods must ALL take parameters. All methods except 1 must return a value.