Created
September 7, 2016 22:42
-
-
Save anonymous/ae12692727c224ab70024c6d1ba4f18f to your computer and use it in GitHub Desktop.
This file contains 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> | |
#define TAX_RATE 0.065 | |
int main(void) { | |
double item_cost, total, total_cost; | |
int items, taxed; | |
printf("What is the cost of the item to be purchased (in dollars)?\n\n"); | |
scanf("%lf", &item_cost); | |
printf("How many of the item are you purchasing?\n\n"); | |
scanf("%d", &items); | |
total_cost = item_cost * items; | |
printf("Is the item a taxed item (1 = yes, 0 = no)?\n\n"); | |
scanf("%d", &taxed); | |
total = total_cost * (TAX_RATE + taxed); | |
printf("The total comes out to $%.2lf", total); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment