logo Hurry, Grab up to 30% discount on the entire course
Order Now logo
572 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Richard RussellResume writing
(5/5)

872 Answers

Hire Me
expert
Angel BoultonStatistics
(5/5)

735 Answers

Hire Me
expert
Xavier FosterrEngineering
(5/5)

564 Answers

Hire Me
expert
malvin kengeEngineering
(/5)

739 Answers

Hire Me
MATLAB
(5/5)

calculate that distance the distance depends on how high the hill is and the radius of the earth

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

 

Program: 

The distance to the horizon increases as you climb a mountain (or a hill). The expression

𝑑 = √2π‘Ÿβ„Ž + β„Ž2

where

 

d =   distance to the horizon, r =    radius of the earth, and h = height of the hill. 

can be used to calculate that distance The distance depends on how high the hill is and the radius of the earth (or another planetary body). Read the heights and print a table with columns: the planet number, mountain height (miles), and distance from the horizon (miles). Print the highest mountain on each planet at the end of the report.

 

Mars, 4th planet from the sun Mons (mountain)

Height* (km)

Arsia Mons

16.0

Ascraeus Mons

18.0

Elysium Mons

12.5

Olympus Mons

27.0

Pavonis Mons

8.7

 

Earth, 3rd planet from the sun Mountains

Height* (ft)

Mount Everest

29029

Aconcagua

22841

Lookout

2392

McKinley

20320

Rainier

14410

Mitchell

6684

 

 
The information about some of the mountains on Mars and Earth is stored in the text data file,

 

mountainHeights.txt,

where

11 is the number of mountains for loop control when reading,

4 and 3 are planet ID numbers to determine where the mountain is, and the second column is the height of the mountains.

 

Note that

Earth’s diameter is 7926 miles. Mars’ diameter is 4217 miles.

Problem Constants:

 

filename

earth_diameter are 7926 miles mars_diameter is 4217 miles

Problem Inputs: 

Problem Outputs:

Other variables: 

Equations:

 Algorithm:

 

% prepare file to read 

% check if the file has been opened 

% CONSTANT VALUES

% print table title and column headers 

% read first value in file; number of mountains numMtn = fscanf(fileID, '%d', 1);

% read the values from data file using fscanf. 

% compute distance from horizon 

% print table with planet number and 

% mountain height and distance from horizon in miles 

% table footer

fprintf('* Units = miles\n\n')

% print highest mountain height for each planet

 

(5/5)
Attachments:

Expert's Answer

572 Times Downloaded

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. ThisΒ  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme