Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Specifications for Functions: Function main ( ) ( this section deals with all the requirements for function main ( ) ) 1 . The only
Specifications for Functions:
Function mainthis section deals with all the requirements for function main
The only variables allowed in this function are: TempC, TLength, MOpt, Sel.
Choose your variable data types carefully.
The menu function should be called to allow the user to select the appropriate
calculation.
Once the selection has been returned, a test must be conducted to determine if
the user terminated the program. If not, the user must enter the values of the
total length of the construction and the maximum temperature deg C to be
considered in the design. See screenshot Figure
The user will now be presented with a list of available construction materials
that could be used, from which the user will be requested to select. See
screenshot Figure
A test should then be performed to ensure that if the material is not available
from the list and the user did not select X in the menu function, then the
variable Sel should be set to the character value of E
A switch statement will then be used to determine what further action should
be taken based on the users initial input from the menu function. Should the
user have terminated the program in the menu function X then the message:
User terminated program, should be displayed. The default message should
display: User termination Material not listed. The switch statement does not
test for the E character, so this becomes the default option.
No calculations or answers should be printed in this function.
Function menuthis section deals only with what is contained in function menu
This function displays the options available to the user as per the screenshot
Figure The layout in the screenshot forms part of the specification.
An unformatted input accepts the users selection into the only variable allowed
in this function, which is Sel.
SFDS GAAssessment GA
A test should be performed to ensure that should the user enter an invalid input,
they will be warned with a message: Invalid option selected! For one second.
See screenshot Figure
No other inputs, calculations or function calls are allowed in this function.
Once you have tested this menu function using a dowhile loop, the total
menu should be refreshed so that the user can reenter the correct value.
Once the correct value has been entered, this function will return the user
selection to the main function.
Function ThermExpansionthis section deals with what is contained in function
Thermexpansion
The task of this function is to do all the calculations relating to the thermal
expansion and temperature conversion from Celsius to Fahrenheit.
All the variable names used in the main function must be used in this function.
Additional variables that must be used are: CoFactor, TempF, Expand.
Since this function is going to be used for either SteelConcrete or Aluminium as
a construction material, a decision must be taken as to which constant
coefficient should be used for the calculation.
The calculations can then be performed, and the display function can be called
to display the answers.
No input or output statement can be used in this function.
Function DisplayAnsThis section deals only with what is contained in function
DisplayAns
The only task of this function is to display the results of the calculations. See
screenshots.
Only the appropriate variable names used in the other functions must be used in
this function.
No heading or subheading can be printed in this function. The heading and subheadings must be displayed in the appropriate locations in the main function.
No input, statements, function calls or other calculations are allowed in this
function.
It is recommended that you first develop the functions above to produce a single set of
calculations before you attempt to implement the second option of the table
SFDS GAAssessment GA
generation. Plan these functions using a flowchart so that you get the calculations and
display operation in the right order. Once the single calculation works properly, then
develop the function below. Test changes made to your program regularly and fix any
syntax errors that may creep into the program.
Function ThermalTableGenThis section deals only with what is contained in
function ThermTableGen
The only task of this function is to generate an Expansion Table: Option in the
menu function.
Only the appropriate variable should be received by this function. An additional
variable must be introduced called Temp.
The minimum temperature of deg C should be set.
A while loop should be used to generate the Expansion Table. The appropriate
function must be called to perform the calculations.
The temperature should be increased by increments of deg C until th
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