fork download
  1. /******************************************************************************
  2.  * AUTHOR : Aiden Stannard *
  3.  * STUDENT ID : 1284603 *
  4.  * Ch3, p144, #10: Celsius To F *
  5.  * CLASS : CS1A *
  6.  * SECTION : T/Th 6PM - 8:20PM *
  7.  * DUE DATE : 9/12/2026 *
  8.  ******************************************************************************/
  9. /******************************************************************************
  10.  * CONVERT CELSIUS TO FAHRENHEIT
  11.  * ____________________________________________________________________________
  12.  * This program converts a given temperature in units of celsius into units of
  13.  * fahrenheit by simply requesting temperature in celsius.
  14.  *
  15.  * Computation is based on the formula: C * (9/5) + 32;
  16.  * ____________________________________________________________________________
  17.  * INPUT
  18.  *Enter Temperature in Celsius(Do not include units):
  19.  *OUTPUT
  20.  *The temperature You Entered is equal to:
  21.  *
  22.  ******************************************************************************/
  23. #include <iostream>
  24. using namespace std;
  25.  
  26. int main() {
  27.  
  28. float C; // Temperature in celsius
  29. float F; // temperature in Fahrenheit
  30.  
  31. cout << "Enter Temperature in Celsius(Do not include units): \n";
  32. cin >> C;
  33. F = C*(1.8) + 32;
  34. cout << "The temperature You Entered is equal to: " << F << " Degrees Fahrenheit";
  35.  
  36. return 0;
  37. }
Success #stdin #stdout 0.01s 5320KB
stdin
10

stdout
Enter Temperature in Celsius(Do not include units): 
The temperature You Entered is equal to: 50 Degrees Fahrenheit