Question

Write a C++ program that will convert distance measurements from miles to kilometers. Specifically, the program...

Write a C++ program that will convert distance measurements from miles to kilometers. Specifically, the program needs to convert 0, 10, 20, 30, 40 , 50, 60, 70, 80, and 90 miles to kilograms displaying both the number of miles and the number of kilograms on the same line. please comment on what is pre and post condition too

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Since exact requirement is not clear to me I am assuming three possible requirement and attaching solutions for it. I hope this will help you. If you do not find the solution as per your requirement feel free to ask.

1 > printing miles to kilometer value for 0,10,20,30,40,50,.......90

2>>> Taking  input from user and converting and printing miles to kilometer value

3>>>>> print miles to kilometer value for all integer in range of [0,100];

Add a comment
Know the answer?
Add Answer to:
Write a C++ program that will convert distance measurements from miles to kilometers. Specifically, the program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program that will convert miles to kilometers and kilometers to miles. The user will...

    Write a program that will convert miles to kilometers and kilometers to miles. The user will indicate both a number (representing a distance) and a choice of whether that number is in miles to be converted to kilometers or kilometers to be converted to miles Each conversion is done with a value returning function You may use the following conversions. 1 kilometer = .621 miles 1 mile = 1.61 kilometers Sample Run: Please input Convert miles to kilometers Convert kilometers...

  • You want to write a converter program which will let user convert distance and weight from SI to ...

    Use functions to complete this C + + program You want to write a converter program which will let user convert distance and weight from SI to the USCS system and vice versa The formulae are as follows: 1. Distance in miles- distance in kilometers x 1.60 2. Weight in kilograms weight in pounds x 2.20 The program would let user input the number that they want to convert and then choose the units to and from which they want...

  • java programming Problem 2) Convert Kilometers to Miles Write a JavaFX program using JavaFX Menu for...

    java programming Problem 2) Convert Kilometers to Miles Write a JavaFX program using JavaFX Menu for to solve the following problem about converting between Kilometers to Miles. Sample Run is shown below You are asked to implement only the menu item under Formulas which reads as"KM to Mile". Choosing this menu item will display the following input box: Input Enter Kilometers Value OK Cancel The result will be displayed in a TextArea as shown below: JavaFĂ— Menu Example " File...

  • Python code please!! Provide code and screenshots to both code and its output!!! Write a program...

    Python code please!! Provide code and screenshots to both code and its output!!! Write a program that prompts the user to select either Miles-to-Kilometers or Kilometers-to-Miles, then asks the user to enter the distance they wish to convert. The conversion formula is: Miles = Kilometers X 0.6214 Kilometers = Miles / 0.6214 Write two functions that each accept a distance as an argument, one that converts from Miles-to-Kilometers and another that converts from Kilometers-to-Miles The conversion MUST be done as...

  • Using Atmel Studios Write an AVR program that convert a distance reading in Miles (variable Mi)...

    Using Atmel Studios Write an AVR program that convert a distance reading in Miles (variable Mi) to Kilometer (variable Km). Include .INCLUDE <m328pdef.inc>

  • Lab-3C   Pre-test Loop Write a MIPS program to count the number of students who failed in...

    Lab-3C   Pre-test Loop Write a MIPS program to count the number of students who failed in a course. The final grades are given in an array. The fail grade is 60. Example: Array and Output      .data NoOfStudents: 10 Values:   60 70 80 50 90 80 55 90 80 70 Output: 2 students failed      .data NoOfStudents: 12 Values:   60 70 80 50 90 80 55 90 80 70 55 80 Output: 3 students failed

  • Write a C# program named Miles-ToEest that declares a named constant that holds the number of...

    Write a C# program named Miles-ToEest that declares a named constant that holds the number of feet in a mile: 5280. Also declare a variable to represent the distance in miles between your house and your uncle's house. Assign an appropriate value to the variable-for example, 8.5. Compute and display the distance to your uncle's house in both miles and feet. Display explanatory text with the values-for example, The distance to my uncle's house is 8.5 miles or 44880 feet....

  • Project 1, Program Design 1. Write a C program replace.c that asks the user to enter...

    Project 1, Program Design 1. Write a C program replace.c that asks the user to enter a three-digit integer and then replace each digit by the sum of that digit plus 6 modulus 10. If the integer entered is less than 100 or greater than 999, output an error message and abort the program. A sample input/output: Enter a three-digit number: 928 Output: 584 2. Write a C program convert.c that displays menus for converting length and calculates the result....

  • C++ Write a program that reads the number of students in the class, then reads each...

    C++ Write a program that reads the number of students in the class, then reads each student's name and his/her test score. Print out each student name, test score and grade, and the average score of the whole class. The program must use vectors and loops for the implementation. The grades are determined as follows: A >= 90; 80 <= B < 90; 70 <= C < 80; 60 <= D < 70; F < 60.

  • write a program in c++ Read an infix expression from an input file and convert to...

    write a program in c++ Read an infix expression from an input file and convert to postfix. Instead of displaying directly on the screen, first place in a queue, and then display the contents of the queue on the screen. Precondition: The expression will be read from a file (input.txt) that contains a single line. There will be no spaces between the operands and the operators. The following operators are allowed: ( ) + - * / The normal rules...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT