Programming Exercise

Functions

 

Modify the pervious program you wrote (to calculate the amount due for a purchase) as follows:

  1. If you used an outer while loop, change it to a do - while (and vice versa). You do not need to change the inner do-while for handling the Taxable question.

  2. Code the prototype and definition of an internal function named SetFixed2( ) that accepts no arguments and returns no value. The function must send the appropriate values to the output stream specifying that all floating-point numbers are to display with two fixed decimal places. You need to call this function from inside your main( ) function.