Hello everyone, im new to c++ and have been having a hard time getting everything squared off.

I am currently in need of help of this program to calculate sales/discount and it is giving me all sorts of problems with the output of just huge numbers. I need help fast Again thanks
 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354`` ``````#include #include #include #define DISCOUNT_10 10.00 #define DISCOUNT_12 12.00 int main(void) { int customer; double purchase; double discount2; double discounttl; double salestax; double purchasettl; printf("Is customer a teacher (Y/N) ?>"); scanf("%c", &customer); printf("\nEnter total purchases:>\n"); scanf ("%lf", &purchase); if (customer == 'Y' && purchase > 100.00) { discount2 = purchase * 0.12; discounttl = purchase * 0.88; salestax = discounttl * 0.05; purchasettl = discounttl * 1.05; printf("\nTotal purchases \$%6.2f\n", purchase); printf("Teacher's discount(%d%%) %6.2lf\n", DISCOUNT_12, discount2); printf("Discounted total %6.2lf\n", discounttl); printf("Sales tax(5%%) %6.2lf\n", salestax); printf("Total %6.2lf\n", purchasettl); } else { discount2 = purchase * 0.10; discounttl = purchase * 0.90; purchasettl = discounttl * 1.05; } printf("\nTotal purchases \$%6.2lf\n", purchase); printf("Teacher's discount (%d%%) %6.2lf\n", DISCOUNT_10, discount2); printf("Discounted total %6.2lf\n", discounttl); printf("Sales tax(5%) %6.2lf\n", salestax); printf("Total %6.2lf\n", purchasettl); if (customer == 'N') { purchasettl = purchase * 1.05; printf("\nTotal purchases \$%.2f\n", purchase); printf("Sales tax(5%%) %.2f\n", salestax); printf("Total %.2f", purchasettl); } system ("pause"); return (0); } ``````

Topic archived. No new replies allowed.