Hey there bud, by the way this is my first ever answer.. woohoo!
Anyways,
It's good practice to be very specific when you write your question on any kind of forum (that's right, it need not even be a programming forum! We might not always interpret your question or your needs correctly if you're not specific.
I'll assume that:
1) input involves taking total cost paid by the passenger, kilometers traveled.
2) cost per kilometer is calculated by: total cost/kilometers.
so we can write a simple console program for this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include<iostream.h>
int main(){
int kilometres, total_cost, cost;
std::cout<< "How many Kilometers has the passenger traveled?\n";
std::cin>> kilometres;
std::cout<< "\nHow much was the total fair?\n";
std::cin>> total_cost;
std::cout<< \n\nIt costed you " << total_cost/kilometres << " per kilometer!";
std::cin.get();
std::cin.get();
}
It is missing the first quote " before \n\nIt costed you" [sic]. Correcting the grammar at the same time, try std::cout<< "\n\nIt cost " << total_cost/kilometres << " per kilometer!";
(On pedantic grounds, "fair" should be "fare" here, as well.)
You will suffer integer division problems unless variables kilometres, total_cost and cost are of type double, rather than int.