computer – lab work on python 2

 

Do the following assignment. please check the attach document.

Temperature-Conversion ProgramDevelop a Python program to

  • Ask the user whether to convert from celsius to fahrenheit or from fahrenheit to  celsius 
  • If the user enters  celsius to fahrenheit, then
    • Ask the user to enter a value for  celsius
    • Use the following formula to convert from  celsius to fahrenheit:
      • Fahrenheit = 9.0 / 5.0 x Celsius +  32
    • Display the entered value for  celsius and the calculated value for fahrenheit, along with appropriate messages
      • See the attached sample program run output to see how data is displayed
  • If the user enters  fahrenheit  to celsius , then
    • Ask the user to enter a value for  fahrenheit
    • Use the following formula to convert from   fahrenheit  to celsius:
      • Celsius = (Fahrenheit − 32) x  5.0 / 9.0
    • Display the entered value for fahrenheit  and the calculated value for celsius, along with appropriate messages.
      • See the attached sample program run output to see how data is displayed.
  • If neither fahrenheit to celsius  nor  celsius  to  fahrenheit  is entered, then
    • Display an error message, such as “Illegal input data was entered.”

NOTE: When setting up the above formulas, ensure to use the right Python operators! 

 You need to set up a  Python solution that is  complete and  workable.  

For your solution to be  complete, you must

  • Prompt the user for the specific input data asked for within the problem statement
  • Set up a correct formula to process the input data, arriving at the output data
  • Provide the output data asked for within the problem statement to the user

For your solution to be  workable,

  • Your solution should be free of any type of errors (syntax, run-time, logic)
  • You may want to develop an algorithm first, using pseudocode or flowchart
  • You do NOT need to turn in any algorithm

================================================================================Grading rubric:

  • You’ll receive full credit, if 
    • your program
      • compiles and runs with no problems 
      • produces the expected output
  • You’ll receive partial credit, if 
    • your program
      • compiles and runs with no problems 
      • produces partial output (that is, incomplete output)
  • You’ll receive 25% of the points, if your program will not compile
  • You’ll receive 30% of the points, if your program compiles but has a run-time problem
  • You’ll receive 40% of the points, if your program produces logic error(s)
  •  
Tags: No tags