Skip to content

Marconi-Lab/cmp1201-assignment-3-temperature-conversion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Assignment 3: Temperature Conversion

Warning: Only create temperature.c. Do not touch Makefile, tests/, or any other file already in the repository. Unauthorised changes to these files will cause your submission to fail automatically.

Objective

Create a file named temperature.c that reads a temperature in Celsius from the user and prints the equivalent temperature in Fahrenheit, formatted to two decimal places.

Conversion Formula

$$F = \left(C \times \frac{9}{5}\right) + 32$$

Expected Output

For an input of 100, your program must print:

Temperature in Fahrenheit: 212.00

Output must match exactly — same capitalisation, spacing, and number of decimal places.

What to Use

  • scanf to read the Celsius value from the user
  • printf with %.2f to print the result

Algorithm Submission

Before writing your code, write out the algorithm (step-by-step instructions in plain English) and save it as a .doc or .docx file. Submit both the algorithm document and your temperature.c as instructed in earlier assignments.

Submission

Submit your work as instructed in earlier assignments — push to your GitHub repository and verify the autograder passes in the Actions tab.

About

CMP1201 Assignment 3: Celsius to Fahrenheit conversion (scanf)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors