Hey guys! First post here.
I'm a C newbie trying to put together a simple program that receives the net cost of a piece of equipment and computes the new and used sale price based on the input. I'm using NetBeans on a windows 10 machine.
The program runs, but it seems to select random numbers for the output. Can anyone spot the inevitably newbie error I'm making in my code?
Thanks!
Code:
#include <stdio.h>
main ()
{
double net,usedprice,newprice;
const double markup = 0.18;
const double taxrate = 0.06;
const double useddisc = 0.50;
printf("Please enter Vittitow's cost:\n");
scanf("%d", &net);
newprice = ((net * markup)+ net) + (net * taxrate);
usedprice = (((net * markup) + net) + net * taxrate) * usedprice;
printf("New Price: $%.1f\nUsed Price: $%.1f\n", newprice, usedprice);
return 0;
}