...
 
Commits (2)
......@@ -3,9 +3,10 @@
int main()
{
/* This application is intended to make determining cost of product/supplies purchased from Canature WaterGroup/Hydrotech Water much easier and fool proof.
/* This application is intended to make determining cost of product/supplies purchased from Canature WaterGroup/Hydrotech Water much easier and fool proof.
In order to use this program, you'll need know what percentage off of list price you're buying at. If you don't know this please contact your sales rep.
*/
*/
printf("Welcome to the Cost Calculator!\nVersion 0.01a\n\n");
printf(" $$ \n");
printf(" $$$$$$$$ CCCCC OOOOO SSSSS TTTTTT\n");
......@@ -26,21 +27,23 @@ int main()
double multiply;
double listprice;
double cost;
char sentinel = ' '; // sentinel for while loop
printf("Enter your cost multiplier: ");
scanf("%lf", &cost);
SomeLine:
printf("Enter the list price: ");
scanf("%lf", &listprice);
multiply = listprice * cost;
/* printf("The Item's List Price is: %f\n", listprice); */
printf("Your Cost Is: %f\n\n", multiply);
goto SomeLine;
while(sentinel != 'q') // Use while loop instead of goto
{
printf("Enter the list price: ");
scanf("%lf", &listprice);
multiply = listprice * cost;
/* printf("The Item's List Price is: %f\n", listprice); */
printf("*Your Cost Is: %.2f*\n\n", multiply); // Limit trailing zeros
printf("c to Continue 'q' to Quit: "); // Illusory choice, 'q' is the only recognized choice
scanf("%c", &sentinel);
}
}