This the full program if anyone needs more
// Preprocessor directive to allow use of print( )
#include <stdio.h>
// Programmer-Created function below
void intro_msg (void);
float get_base1 (float);
float read_base1 (float);
float get_base2 (float);
float read_base2 (float);
float get_height (float);
float read_height (float);
float calc_area (float);
float display_results (float);
void outro_msg (float);
int main( void )
{
//STEP 1:Introduce Program:This program calculates the
// area of a trapazoid (Accomplished with a
// Programmer-Created function named
// intro_msg( ) )
intro_msg( );
//STEP 2: Ask user to enter the trapazoid's first base
// (Accomplished with Programmer-Created funtion
// named
// get_base1( ) )
get_base1( );
//STEP 3: Read the user's input for base 1 (Accomplished
// with Programmer-Created function named
// read_base1( ) )
read_base1( );
//STEP 4: Ask user to enter the trapazoid's second base
// (Accomplished with Programmer-Created function
// get_base2( ) )
get_base2( );
//STEP 5: Read the user's input for base 2 (Accomplished
// with Programmer-Created function
// read_base2( ) )
read_base2( );
//STEP 6: Ask user to enter the trapazoid's height
// (Accomplished with Programmer-Created function
// get_height( ) )
get_height( );
//STEP 7: Read the user's input for (Accomplished with
// Programmer-Created function
// read_height( ) )
read_height( );
//STEP 8: Calculate trapazoid's area using formula:
// area = 0.5 * (base1 + base2) * height
// (Accomplished with Programmer-Created function
// calc_area( ) )
calc_area( );
//STEP 9: Display Results (Accomplished with Programmer-
// Created function
// display_results( ) )
display_results( );
//STEP 10: Sign off with user (Accomplished with
// Programmer-Created function
// outro_msg( ) )
outro_msg( );
//STEP 11: Terminate
return (0) ;
}
// Programmer-Created funtions below
void intro_msg (void)
{
printf("\n This program calculates the area of a trapazoid");
return 0 ;
}
float get_base1 (float)
{
printf("\n Please enter the first base of the trapazoid: ");
return 0 ;
}
float read_base1 (float)
{
float base1 = 0.0
scanf("f" , &base1);
return base1;
}
float get_base2 (float)
{
printf("\n Please enter the second base of the trapazoid: ");
return 0 ;
}
float read_base2
{
float base2 = 0.0
scanf("f" , &base2);
return base2;
}
float get_height (float)
{
printf("\n Please enter the height of the trapazoid: ");
return 0 ;
}
float read_height (float)
{
float height = 0.0
scanf("f" , &height);
return height;
}
float calc_area (float)
{
float area = 0.0
area = 0.5 * (base1 + base2) * height;
return area ;
}
float display_results (float area)
{
printf("\n The area of the trapazoid is: %f \n");
return 0 ;
}
void outro_msg (void)
{
printf("\n Thank you for using this program, have a nice day.")
return 0 ;
}