View Single Post
Join Date: Oct 2008
Posts: 5
Reputation: XxAaronxX is an unknown quantity at this point 
Solved Threads: 0
XxAaronxX XxAaronxX is offline Offline
Newbie Poster

Help with Measurement converter

 
0
  #1
Nov 25th, 2008
Hey I am trying to teach myself C++ and i am having trouble with a measurement converter I am pretty sure my problem is in the line

  1. Yards = Meters * 1.094;

but i don't know how else to write it, this is my code:

  1. #include <iostream>
  2. namespace std;
  3.  
  4. int main()
  5. {
  6. cout << "welcome to my measurement converter.";
  7. cout << "This converter will convert meters to yards.\n";
  8. cout << "Enter the number of meters.\n";
  9. int Meters;
  10. int Yards;
  11. cin >> Meters;
  12. Yards = Meters * 1.094;
  13. cout << Meters << " meters is equal to " << Yards << " yards";
  14. return 0;
  15. }

Your help would be greatly appreciated
Reply With Quote