-
-
Save nathanchere/aa89167bff015f627af2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <float.h> | |
// declare global variables | |
float qrt; | |
float dim; | |
float nik; | |
float pen; | |
float chg; | |
//declare functions | |
float GetChange(float i); | |
float MakeChange(float j); | |
//main application logic | |
int main() | |
{ | |
qrt = 0.25; | |
dim = 0.10; | |
nik = 0.05; | |
pen = 0.01; | |
chg = 0; | |
chg = GetChange(chg); | |
MakeChange(chg); | |
} | |
//define functions | |
float GetChange(float i) | |
{ | |
do | |
{ | |
printf ("Enter the amount of change owed:\n" ); | |
scanf ("%d", &i); | |
//printf ("You entered: %i\n", i); | |
if (i < 0 ) | |
{ | |
printf ("Please enter a positive number\n"); | |
} | |
}while (i < 0); | |
return i; | |
} | |
float MakeChange(float j) | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment