Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 1 meter per 3.2808 feet
In the main function of the main source file, create 7 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.
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:
The mountain with the smallest elevation is: Mount Marcy - Adirondacks, United States, with an
elevation (ft) of : 5344ft
Note: Make sure that you put the header comments in this main.cpp and all other cpp files file. Instructor note:
If you are developing on an external environment, note that this is a multi file project. In order to compile and
link this program, you could use the command (in the same directory/folder that the .cpp and .h files)
g++-o main *.cpp Instructor note:
If you are developing on an external environment, note that this is a multi file project. In order to compile and
link this program, you could use the command (in the same directory/folder that the .cpp and .h files)
g++-o main *.cppNotes are given for which parts you will need to pay attention to.
The following data will be used for this project
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 1 meter per 3.2808 feet
In the main function of the main source file, create 7 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.
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). and i need main.cpp, mountain.cpp, mountain.h
image text in transcribed

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

More Books

Students also viewed these Databases questions

Question

What is the central issue of the situation facing the organization?

Answered: 1 week ago