Click here to Skip to main content
15,938,122 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I need this code for an assignment please:

Write the algorithm and Python code to convert measurements made in inches to millimeters. The conversion is as follows: 1 inch is equivalent to 25 millimeters. The program should ask the user if they would like to convert another measurement and run again if “y” or “Y” is entered by the user. Any other entry should cause the program to terminate. Enter multi-line comments as needed and test the code.

And what I have so far is this:

#This program converts measurements made in inches to millimeters.
"""

Created By:
Date: 12/14/2017
Class: CSIT 100-41
"""

DoAgain = "Yes";

while DoAgain == "Yes" or DoAgain == "y":
print("Welcome to the Conversion Calculator")

Inches= float(input("Please enter the number of inches: "))

Total= Inches * .25

I think its wrong but idk how to fix it, please help anyone.

What I have tried:

#This program converts measurements made in inches to millimeters.
"""

Created By:
Date: 12/14/2017
Class: CSIT 100-41
"""

DoAgain = "Yes";

while DoAgain == "Yes" or DoAgain == "y":
print("Welcome to the Conversion Calculator")

Inches= float(input("Please enter the number of inches: "))

Total= Inches * .25
Posted
Comments
Patrice T 15-Dec-17 0:30am    
"I think its wrong"
What make you think it is wrong?
Richard MacCutchan 15-Dec-17 4:16am    
This has nothing to do with programming; you are using the wrong value in your conversion calculation. Open your calculator, or use Google, to see what number to use to convert inches to millimeters.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900