Answered step by step
Verified Expert Solution
Question
1 Approved Answer
As a Software Developer, you are tasked by an international construction company expansion Calculator program. When a bridge or overhead walkway is constructed, the Engineer
As a Software Developer, you are tasked by an international construction company expansion Calculator program. When a bridge or overhead walkway is constructed, the
Engineer must consider that the material used in the construction will expand or
contract in response to temperature variations. Failure to take the material
expansioncontraction into account could potentially lead to severe damage to these
structures, and endanger the safety of the public.
To solve this problem, the engineer needs to determine by how much the length of the
structure will change, and build in a safety factor. The total length of the bridge must be
taken into consideration when determining the expansion length, then allowance
should be made for this movement by including expansion joints gaps over the total
length of the bridge.
Since different construction materials expand and contract at different rates to a
temperature change, a linear expansion coefficient is introduced which has been
determined for various materials. Steel and concrete have the same coefficient
CTECS which is
and aluminium has a coefficient CTEA of
The
coefficient values are constant. The constant identifier names are shown above in
parentheses.
This multifunction program must give the user the opportunity to select the desired
calculation via a menu. This menu will allow the user to select either a single calculation
or generate an expansion table. Once the user has selected their option, the program
will test for a valid user input. If the input is valid, then it will ask the user to enter
certain parameters and the material used before proceeding to the next stage of the
program. Should the users input be invalid, the program will not ask the user to enter
these parameters and will proceed to the next stage. The next stage determines what
further action should be taken based on the users initial selection.
Careful attention should be taken in designing this program according to the specified
structure. It is strongly advised that this program be developed in stages. After each
section is completed, the program must be tested. Do not continue development of the
program if a particular section does not work. If the program cannot compile and
execute successfully, it will incur severe loss of marks.
At all times, adhere to the specifications, as marks are allocated accordingly.
SFDS GAAssessment GA
Program Specification
A Title Block must be created and appear above the source code of your program. The
title block must contain the following: Name, Surname, Student Number, and Date.
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 lo
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