d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > C++ Question
123Next
Add Reply New Topic New Poll
Member
Posts: 31,523
Joined: Mar 31 2004
Gold: 6.57
Oct 21 2013 08:15pm
I'm trying to write program that will enter a % of mark up.. I want to do all cases that if person enters % it will conver it to decmial by diving by 100 but what if they enter decimal is there a way or % do it the other way?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 21 2013 08:24pm
Multiply by 100.
Member
Posts: 31,523
Joined: Mar 31 2004
Gold: 6.57
Oct 21 2013 08:30pm
Quote (carteblanche @ 21 Oct 2013 22:24)
Multiply by 100.


why post troll?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 21 2013 08:38pm
Quote (Katelyn @ Oct 21 2013 10:15pm)
I'm trying to write program that will enter a % of mark up.. I want to do all cases that if person enters % it will conver it to decmial by diving by 100 but what if they enter decimal is there a way or % do it the other way?


Quote (carteblanche @ Oct 21 2013 10:24pm)
Multiply by 100.


Quote (Katelyn @ Oct 21 2013 10:30pm)
why post troll?


you already know how to convert percent to decimal. sounds like you're asking how to convert decimal to percent. if that's not what you're asking, then what are you asking? don't need your attitude.
Member
Posts: 10,812
Joined: Oct 15 2009
Gold: Locked
Warn: 20%
Oct 21 2013 08:45pm
Quote (Katelyn @ Oct 21 2013 07:30pm)
why post troll?


I don't see how that is a troll, if you don't like the answer to your question, perhaps ask a different question; or better yet, post a snippet.

This post was edited by Azrad on Oct 21 2013 08:45pm
Member
Posts: 31,523
Joined: Mar 31 2004
Gold: 6.57
Oct 21 2013 08:49pm
I'm asking how can The program tell if person entered a % or decmail.. herpderp
Member
Posts: 31,523
Joined: Mar 31 2004
Gold: 6.57
Oct 21 2013 08:52pm
like


cout << "Please enter tax" << endl;
cin >> tax;



how do I know if tax = 8.25% or tax = .0825


so i know how to handle next statment?
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Oct 21 2013 08:52pm
Quote (Katelyn @ Oct 21 2013 10:49pm)
I'm asking how can The program tell if person entered a % or decmail.. herpderp


you look for the % sign. herpderp
Member
Posts: 31,523
Joined: Mar 31 2004
Gold: 6.57
Oct 21 2013 08:54pm
Quote (carteblanche @ 21 Oct 2013 22:52)
you look for the % sign. herpderp


if i knew how to do that I would.
Member
Posts: 1,358
Joined: Dec 30 2012
Gold: 0.10
Oct 21 2013 09:41pm
Google, c++ modulus operator
Go Back To Programming & Development Topic List
123Next
Add Reply New Topic New Poll