Dept. of Computer Science & Engineering @ Seoul National University Programming Assignment 1. Temperature Converter Deadline: 2018/12/7 1:00PM 2018 Fall Computer Concept & Practice Prof. Sang Lyul Min TA: Minwook Kim (ace@snu.ac.kr)
Temperature scales Celsius Definition • freezing point of water is defined to be 0°C and boiling point of water is defined to be 100°C (at 1 atm pressure), a 100°C separation. Fahrenheit Definition • freezing point of water is defined to be 32°F and boiling point of water is defined to be 212°F (at 1 atm pressure), a 180°F separation. Scale conversion (Fahrenheit to Celsius) � F2C: � Absolute zero The lowest limit of the thermodynamic temperature scale. -273°C (approximation) Dept. of Computer Science & Engineering 2 @ Seoul National University
F2C Converter Basic function input: the temperature expressed in Fahrenheit scale output: converted temperature in Celsius scale Restriction Your program must print a prompt message to tell the user as entering a Fahrenheit scale temperature. The printed result must have two or more significant digits below the decimal point. ( 소수점 아래 2 개 이상의 유효 숫자 ) If converted value(in Celsius) is smaller than the absolute zero(-273°C), your program must tell the input is invalid and ask user a new input value. This process should be repeated until the input value is converted in the valid range(≥ -273°C ) . Submission You should make a ‘f2c’ subdirectory in your home directory. Only your C source code and compiled execution file must be in the ‘f2c’ directory. Dept. of Computer Science & Engineering 3 @ Seoul National University
Example Dept. of Computer Science & Engineering 4 @ Seoul National University
Recommend
More recommend