Programming Assignment 1. Temperature Converter Deadline: 2018/12/7 - - PowerPoint PPT Presentation

programming assignment
SMART_READER_LITE
LIVE PREVIEW

Programming Assignment 1. Temperature Converter Deadline: 2018/12/7 - - PowerPoint PPT Presentation

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)


slide-1
SLIDE 1
  • 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)

slide-2
SLIDE 2
  • Dept. of Computer Science & Engineering

@ Seoul National University

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)

2

slide-3
SLIDE 3
  • Dept. of Computer Science & Engineering

@ 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.

3

slide-4
SLIDE 4
  • Dept. of Computer Science & Engineering

@ Seoul National University

Example

4