Converts,Either,Fahrenheit,Calcius,Good,Begin
Quick Search for: in language:   
Converts,Either,Fahrenheit,Calcius,Good,Begin
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
C/ C++ Stats

 Code: 326,796 lines
 Jobs: 876 postings

 

You are in:

 
Login


Latest Code Ticker for C/ C++
Click here to see a screenshot of this code!Desktop Environment for DOS
By Sandy Chakraborty on 2/25

(Screen Shot)

kbc
By Alok Gupta on 2/25


counting letters
By Joost Cuppen on 2/25


bouncing a ball
By Rakshit Desai on 2/25


fibonacci series
By Rakshit Desai on 2/25


i am a fool
By Rakshit Desai on 2/25


Click here to see a screenshot of this code!Phat Tic-Tac-Toe v2.01
By Artem on 2/24

(Screen Shot)

Mouse Hot Keys
By Aidman on 2/24


Easy Delay Function
By mr_puniverse00 on 2/24


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 

 
 

   

Simple Hello-World Type C++ Console Temp. Conv.

Print
Email
 
VB icon
Submitted on: 12/25/1999
By: Jeff Katz  
Level: Beginner
User Rating: By 13 Users
Compatibility:C++ (general)

Users have accessed this code 4507 times.
 
 
     Converts Either Fahrenheit to Calcius or Calcius to Fahrenheit, Good For Beginners. | If You Like It, Vote Highly For It!
 

INCLUDE files:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!

//**************************************
//     
//INCLUDE files for :Simple Hello-World 
//     Type C++ Console Temp. Conv.
//**************************************
//     
iostream.h, conio.h
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for langauges that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

//**************************************
//     
// Name: Simple Hello-World Type C++ Con
//     sole Temp. Conv.
// Description:Converts Either Fahrenhei
//     t to Calcius or Calcius to Fahrenheit, G
//     ood For Beginners. | If You Like It, Vot
//     e Highly For It!
// By: Jeff Katz
//
// Assumes:Must be a console application
//     
//
//This code is copyrighted and has// limited warranties.Please see http://
//     www.Planet-Source-Code.com/xq/ASP/txtCod
//     eId.259/lngWId.3/qx/vb/scripts/ShowCode.
//     htm//for details.//**************************************
//     

#include <iostream.h>
#include <conio.h>
double ctof(double x);
double ftoc(double x);
void ftocf();
void ender();
void ctoff();
int op;
void main ()
    {
    op=0;
    cout<<"Select an Option:"<<endl;
    cout<<" 1 for F to C"<<endl;
    cout<<" 2 for C to F"<<endl;
    cout<<" 3 To End"<<endl;
    cin>>op;
    if(op==1) ftocf();
    if(op==2) ctoff();
    if(op==3) ender();
}

void ctoff() { int x; cout<<"Enter Degrees Celcius to Make Into Fahrenheit:"<<endl; cin>>x; cout<<"Result: "<<ctof(x)<<endl<<endl; main(); }
void ftocf() { int y; cout<<"Enter Degrees Fahrenheit to Make Into Celcius:"<<endl; cin>>y; cout<<"Result: "<<ftoc(y)<<endl<<endl; main(); }
double ctof(double x) { return ((x*1.8)+32); }
double ftoc(double y) { return ((y-32)/1.8); }
void ender() { cout<<"Press Any Key to Exit"<<endl; getch(); }

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The codewith your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments

 There are no comments on this submission.
 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | C/ C++ Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.