Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Chres mod resource/content/7/EPRO 10049520Programming%20Final%20Assessment%20202003 v1 pe Programming Tasks . Your task is to develop a working C program that will: Automatically open a data

image text in transcribedimage text in transcribedimage text in transcribed

Chres mod resource/content/7/EPRO 10049520Programming%20Final%20Assessment%20202003 v1 pe Programming Tasks . Your task is to develop a working C program that will: Automatically open a data file that contains the Manning roughness values. There should be five entries, one per line, in this file. Each line will consist of a name for the material and the associated roughness. The name of the file is up to the developer but should reflect the contents of the file. Open then read the data file. If the file is not found, appropriate action should be taken. Ask the user for the appropriate geometric values, channel width & depth, rise and run. There should be range checking on the depth only. The user must enter a positive number. Draw a shape, using stars and dashes that gives an indication of the size of the channel. Refer to Figure 4. In this example, you will see that the input width is 12m hence there are 12 stars between the walls. The depth is 10m hence there are 10 stars from the base to the water surface. The water surface consists of stars and dashes. There should be one star above the water surface. The dimensions of the channel should also be labelled approximately as shown in the figure. Obviously the size & shape will change depending upon the entered channel dimensions. A table should be created that has the slope as the X axis and the materials as the Y axis, refer to the bottom section of Figure 4. None of the information in the table shall be hard coded - it should all be either read from the data file or calculated. If the name of a material is changed in the file, the entry in the Y axis will change. If the initial slope is changed, due to different data entry, then the slope values will also change. The flow rates will to be calculated for each material/slope pair. The channel shape and the results table will need to be written to both the screen and a text file. The text file shall be named the AdventuresOfZorro.txt. The opening of the results file must be checked to ensure it is successful. If not successful, an error message output and appropriate action taken. You should demonstrate good programming practise, making use of functions and return values. As files are being opened, care should be taken to ensure the opening has actually succeeded. Magic Numbers should not be used. The code should be well laid out and consistent in format. Variable names are expected to provide an indication of their purpose. W

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Accounting Understanding And Practice

Authors: Robert Perks

4th Edition

9780077139131

Students also viewed these Accounting questions