Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java Please The following data will be used for this project Mountain Country Elevation Chimborazo Ecuador 2 0 , 5 4 9 ft Matterhorn Switzerland
Java Please
The following data will be used for this project
Mountain Country Elevation
Chimborazo Ecuador ft
Matterhorn Switzerland ft
Olympus Greece Macedonia ft
Everest Nepal ft
Mount Marcy Adirondacks United States ft
Mount Mitchell Blue Ridge United States ft
Zugspitze Switzerland ft
Write a program that will include the following:
A class that will store mountain details which will included the following:
List item
Member for the name, make it private
Member for the country, make it private
Member for the elevation, make it private
Setters and getters for all the data members. Make them public
A member function call toMeters that will take the elevation and convert the value from feet to meters and return the converted value. The relationship for feet to meters is meter per feet
In the main function of the Main class, create instances of Mountain objects and put the mountain data from the table above.
Put the mountain objects in an appropriate data structure for the language that you are writing this for. Sort the structure using a sort method.
Write a method called minElevation that will return the minimum elevation.
Iterate over the data structure that contains the Mountain objects and print out the Mountain details similar to the table above, with the addition of the elevation in feet and in meters.
Programmatically print out the elevation and name of the shortest mountain do not hard code this
The output for this program should be the following:
Minimum Elavation ft
Chimborazo, Ecuador: ft OR meters Matterhorn, Switzerland: ft OR meters Olympus, Greece Macedonia: ft OR meters Everest, Nepal: ft OR meters Mount Marcy Adirondacks, United States: ft OR meters Mount Mitchell Blue Ridge, United States: ft OR meters Zugspitze, Switzerland: ft OR meters
Mount Marcy Adirondacks, United States: ft OR meters Mount Mitchell Blue Ridge, United States: ft OR meters Olympus, Greece Macedonia: ft OR meters Zugspitze, Switzerland: ft OR meters Matterhorn, Switzerland: ft OR meters Chimborazo, Ecuador: ft OR meters Everest, Nepal: ft OR meters
Mount Marcy Adirondacks is the smallest
Note: Make sure that you put the header comments in this main class file.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started