Solved

# Get cost per mile

Posted on 2014-04-21
257 Views
Is there a way to get cost per mile only using multiplication any numbers are good positive or neg

example:

Total Revenue= \$100
Total Miles = 100
Cost per Mile = \$1
0
Question by:Blueice13085
• 5
• 5
• 3
• +2

LVL 5

Expert Comment

ID: 40013489
Not sure what you're asking..
I'm assuming you're wondering
let x represent total miles
let y represent cost per mile
x * y = total cost
0

LVL 74

Expert Comment

ID: 40013501
Does exponentiation count as multiplication? If so:

``````cpm = tRev * (tMiles ^ -1)
``````
0

Author Comment

ID: 40013521
Pasha Kravtsov to use your way it would look like this

let X represent total miles
let Y represent cost per mile
let R represent total revenue
let N represent (your choice of ANY number)

X*R*N=Y
0

Author Comment

ID: 40013525
whats ^ represent?
0

LVL 17

Expert Comment

ID: 40013529
You could multiply the total cost by the inverse of the number of miles. It isn't quite division but it has a similar result.
0

LVL 74

Expert Comment

ID: 40013530
"Raised to the power."
0

Author Comment

ID: 40013557
Elaine and Kaufmed can you give me some examples so i can see what you are talking about thanks
0

LVL 74

Expert Comment

ID: 40013568
Elaine is mentioning exactly what I am talking about. I am simply showing it in mathematical terms.

All I am saying is that you raise the total miles to the -1 power--this creates the inverse that Elaine mentioned. Then the remaining operation is multiplication.

I'm not sure how much more of an "example" I can provide. I suppose I can plug in the numbers that you show:

``````cpm = tRev * (tMiles ^ -1)

1.00 = 100.00 * (100 ^ -1)
``````
0

LVL 17

Expert Comment

ID: 40013676
Kaufmed, thanks for explaining. I am viewing this in mobile interface and sorry, but I hadn't opened your code snippet so I may have repeated your answer.
0

Author Comment

ID: 40013813
what i mean is i dont have a way of using ^ -1 so how can i replace the ^ would this just be like this

1.00 = 100 *( 100*100*-1)
0

LVL 52

Expert Comment

ID: 40013905
No points - yes

Is this for a website?  Which language are you using?  Javascript, php, vb, vbscript, something else?
0

LVL 17

Expert Comment

ID: 40014195
Some languages use double star (**) to raise to a power.
0

Author Comment

ID: 40014307
here is some screen shots i made. The X is the same as *

i can only use #'s no Signs like *,^,etc...

0

LVL 17

Expert Comment

ID: 40014389
If that is the tool you have to work with I think you could only do it by manually calculating the inverse of the distance and inputting the result.
So for instance
Total cost= 120
Miles=50

Inverse miles = 1/50 (1 divided by 50) = 0.02

So input 120 x 0.02 to get 2.4 per mile.
0

LVL 17

Accepted Solution

Thibault St john Cholmondeley-ffeatherstonehaugh the 2nd earned 500 total points
ID: 40014391
But beware because that looks like you are calculating total cost by adding different expenses. Surely you should be inputting cost per mile and the number of miles to let it calculate the total cost for you?
0

## Join & Write a Comment Already a member? Login.

### Suggested Solutions

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
We are taking giant steps in technological advances in the field of wireless telephony. At just 10 years since the advent of smartphones, it is crucial to examine the benefits and disadvantages that have been report to us.
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

#### 708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

#### Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!