Monday, May 24, 2010

I need help on C++ Programming help FAST?

I need help on creating a program that will ask a user to input the amount, calculate sales tax, and calculate the total by adding the tax w/ the original price. Then display the total sales. I am new at this program so please help. I have downloaded the C++ program 2 my computer, but I am still a little lost.

I need help on C++ Programming help FAST?
Try opening your textbook FAST and reading up on the subject! Then maybe your class notes will make sense. You did take notes, right?
Reply:First, C++ is not a program. It's a programming language. I don't know what you mean by "I have downloaded the C++ program" because that is impossible.





Second, it's a very complicated language and is very difficult to learn. Do you have any experience in another object-oriented language? If not, I'd recommend you try something a little easier (Like, XHTML and then PHP) and then move up to another language like Python or Ruby. Then maybe Java. After that, you should be good to learn C++.





However, if you think it's a program... Well, then you're probably not going to have much success learning anything.





Good luck.





If you just need a quick little thing...


Set up the basics (#includes and your namespace)





Then, put this in main():


cout %26lt;%26lt; "Please enter the subtotal.";


int subtotal;


cin %26gt;%26gt; subtotal;


int tax;


tax = [put your tax rate here]; (This will probably change... I'm not very good at doing math with percentages)


int total;


total = subtotal * tax;


cout %26lt;%26lt; "Your total is: " + total;





This probably isn't 100% correct (I haven't used C++ in about a year now) but that's the basic gist of it.





Regards.
Reply:Start by writing or downloading a "Hello World" program, or some other simple program that enters a value and displays it, or some simple calculated value based on it.





Once you get that to compile and run, you should be able to add the other stuff with some degree of success.
Reply:I guess the C++ program u mentioned is a Compiler of IDE (intergrated Development Environment) like Dev-C++, Borland, Visual C++ express.... etc





well,


I would suggest a few simple functions.... get ur text book hav a read on it, would help u understand more than getting the answer directly.





1. we will need variable : etc.... int total, / float tax..


2. get user input : cin%26gt;%26gt;total;


3 perform calculation....


total+=tax;


or example : a = b + c; // example of writing code


4. finally for displaying the result, example: cout%26lt;%26lt;"the result is";





things are quite easy, just get started slowly, or u may find a lot tips at www.cprogramming.com


No comments:

Post a Comment