Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Have to use this as well Trail_list[10]; for (int i = 0; i scan_trails(&list[i],inp); Define the following data type that contains hiking trail information. typedef

image text in transcribedimage text in transcribed

Have to use this as well

Trail_list[10];

for (int i = 0; i

scan_trails(&list[i],inp);

Define the following data type that contains hiking trail information. typedef struct char Trail.Name [20] double Total Dist.ft int Min Elev ft int Max Elev ft int Elev-gain-fti int Trail.Ratingi ) Traili Develop a C program that reads a file called Hiking-Trail.Data.txt into a 10-element array of type Trail. The file Hiking_Trail Data.trt contains the name of the trail, the length of the trail in miles, the minimum elevation of the trail in feet, and the maximum elevevation (also in feet). You will need to calculate the trail difficulty rating. The trail difficulty rating is calculated by the formula Elev gain ft2 Max Elev _ft Total Dist ft Trail Rating - 100 Note: You will have to calculate Elev_gain ft. This value is calculated by Max Elev ft - Min Elev ft Total Dist ft has units of feet. However, the file Hiking Trail Data.txt contains the distance in miles so you will need to convert using 5280 Trail Rating is unitless. Round Trail Rating to the nearest integer mile The program then prints the trail list sorted by Trail Rating. Your program should use the following functions void scan-trails (Trail *x,FILE*in) void print.trails (Trai1 *x)

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_2

Step: 3

blur-text-image_3

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions