Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. Temperature conversion

Temperature conversion

Scheduled Pinned Locked Moved Managed C++/CLI
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    klutez123
    wrote on last edited by
    #1

    i need to make the conversions to its own function. i was told to use: void convert_to_f() void convert_to_c() as function names. please help, thank you #include int main() { int temp, fahr, cel, f_out, yes, no, choice, c_out; do { cout<<"Please choose one of the following conversions\n"; cout<<"1 - Celcius to Fahrenheit.\n"; cout<<"2 - Fahrenheit to Celcius.\n"; cout<<"Please select at this time: "; cin>>temp; switch(temp) { case 1: cout<<"You choose Celcius to Fahrenheit.\n"; cout<<"Please enter the degrees in Celcius: "; cin>>cel; f_out = (cel * 1.8) + 32; cout<<"The degrees converted into Fahrenheit is "<>fahr; c_out = (fahr - 32) / 1.8; cout<<"The degrees converted into Celcius is "<>choice; } while(choice==1); return 0; }

    M 1 Reply Last reply
    0
    • K klutez123

      i need to make the conversions to its own function. i was told to use: void convert_to_f() void convert_to_c() as function names. please help, thank you #include int main() { int temp, fahr, cel, f_out, yes, no, choice, c_out; do { cout<<"Please choose one of the following conversions\n"; cout<<"1 - Celcius to Fahrenheit.\n"; cout<<"2 - Fahrenheit to Celcius.\n"; cout<<"Please select at this time: "; cin>>temp; switch(temp) { case 1: cout<<"You choose Celcius to Fahrenheit.\n"; cout<<"Please enter the degrees in Celcius: "; cin>>cel; f_out = (cel * 1.8) + 32; cout<<"The degrees converted into Fahrenheit is "<>fahr; c_out = (fahr - 32) / 1.8; cout<<"The degrees converted into Celcius is "<>choice; } while(choice==1); return 0; }

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      1. This is not managed C++, please post in the C++ forum[^] 2. You need to say what problem you're having with the code.

      --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups