You are here:

C++/c++ program

Advertisement


Question
hello sam i am trying to code this c++ program, and will run it on a windows command prompt using a compiler. it's probably simple for you:

I want to create a c++ program that converts a Fahrenheit temperature to a celsius temperature.  the program must have a main() function, a getFahrenheit() function that gets a Fahrenheit temperature from the user, and a calcCelsius() function that calculates the corresponding Celsius temperature.

Answer
What you need to do is summerized below:

double calcCelsius(double in){
 // return the converted temperature
}

void getFahrenheit(){
 double in, out;
 // read using cin
 out = calcCelsius(in);
 // write using cout
}

int main(){
 getFahrenheit();
 return 0;
}

In case you need help with details, you may email me on sam@shabah.net

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Sam

Expertise

You may ask me about simple to complicated C/C++ programming methods/style and most like questions about network programming in C++.

Experience

I'm a professional programer in C++ and network/internet programming.

©2016 About.com. All rights reserved.