Sunday, August 2, 2009

What the heII is wrong now? I can't seem to get this program to work, it keeps saying that the total is 0.00..

DEV C++





Program Name : NYS Product Tax





Can you help me please with my programming?





I asked another question similar to this one, and they helped me and I got it, but then I tried to ask for user input, to specify a spacific price amount, and now its giving me 0.00.





http://answers.yahoo.com/question/index;...





#include %26lt;cstdlib%26gt;


#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using namespace std;





int main(int argc, char *argv[])


{














double Price; // Price Of Product


double tax=0.08123; // NYS Tax


double a=Price*tax; // Price Times Tax


double b=Price+a; // Price Pluss Total of Tax Times Price





cout %26lt;%26lt; "How Much Is This Product : ";


cin %26gt;%26gt; Price;





system ("pause");


system ("cls");





cout.setf(ios::fixed);


cout %26lt;%26lt; "The Total Price Of The Product, After Tax Will Be ";


cout %26lt;%26lt; setprecision(2) %26lt;%26lt; b;


cout %26lt;%26lt; endl;


cout %26lt;%26lt; endl;





system("pause");


system("cls");





}





It Keeps Saying 0.00

What the heII is wrong now? I can't seem to get this program to work, it keeps saying that the total is 0.00..
You have to ask for price before you compute tax :)





#include %26lt;cstdlib%26gt;


#include %26lt;iostream%26gt;


#include %26lt;iomanip%26gt;





using namespace std;





int main(int argc, char *argv[])


{





double Price; // Price Of Product





cout %26lt;%26lt; "How Much Is This Product : ";


cin %26gt;%26gt; Price;





double tax=0.08123; // NYS Tax


double a=Price*tax; // Price Times Tax


double b=Price+a; // Price Pluss Total of Tax Times Price











system ("pause");


system ("cls");





cout.setf(ios::fixed);


cout %26lt;%26lt; "The Total Price Of The Product, After Tax Will Be ";


cout %26lt;%26lt; setprecision(2) %26lt;%26lt; b;


cout %26lt;%26lt; endl;


cout %26lt;%26lt; endl;





system("pause");


system("cls");





}
Reply:And yet you pick as best answer the guy who blatantly stole my answer. Yes, I guess that doesn't make you a dummy. Guess what name I'm calling you instead? Report It

Reply:stole the answer from where? Any software developer would solve his problem... Report It



No comments:

Post a Comment