Please can somebody help me with the line of codes of this question:write a C++ program which inputs litre consumption given in miles/gallon and which translates these figures into the litres/kilometre format which is more common in Europe.Use the following conversion factors: 1 mile=1.609km and 1 gallon= 3.785litres
folabidowu
0
Newbie Poster
Recommended Answers
Jump to PostThe values you need are km per mi and gl per lt not lt per gl
1mi=1.609km
1lt=0.264172gllt/km = (mi/gl) * (km/mi) * (gl/lt) lt/km = (given) * 1.609 * 0.264 lt/km = (given) * 0.425
Hope that helps.
All 3 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.