Thread: C++ Help
View Single Post
Old 09-15-2005, 04:15 PM   #5
soccr743
FFR Player
Retired Staff
 
soccr743's Avatar
 
Join Date: Dec 2003
Posts: 549
Send a message via AIM to soccr743 Send a message via MSN to soccr743 Send a message via Yahoo to soccr743
Default Re: C++ Help

Quote:
Originally Posted by JurseyRider734
To make a profit, a local store marks up the prices of its items by a certain percentage. Write a C++ program that reads the original price of the item sold, the percentage of the marked-up price, and the sales tax rate. The program then outputs the original price of the item, the percentage of the mark-up, the store's selling price of the item, the sales tax rate, the sales tax, and the final price of the item. (The final price of the item is the selling price plus the sales tax.
First off, are you reading this from a file? Or from the command prompt...

Secondly, you need to just know math. Just use the variable type "float" for the variable in this case.

Thirdly, you need to know how to convert from a string or char* to a floating point number. I use my own String class library, so I am not sure if the standard library contains a method for converting strings to integers or floats.

-----Soccr743-----
__________________
soccr743 is offline   Reply With Quote