Alrightm I finished but it looks totally different. I need to write a function that will round any given number to the 10th decimal place.
Code://Chris Taylor //March 15th, 2006 //Intermediate C++, Terminal 6. //Cube Thingy #include <iostream.h> #include <fstream.h> #include <conio.h> //Prototype statements void pdescription(); int choice (int choose); float c(float fa); float f(float ce); void output(float fa, float ce); int main() { //Variable declaration float fa=32; //Fahrenheit variable. float ce=0; //Celsius variable. int choose=0; //Stored for intial choice. pdescription();//Calls the function "description" choice (choose);//Calls the function "choice" if (choose==0)//Determines what is being converted to what. { f(ce); } else { c(fa); } output(fa, ce); getch(); return 0; } void pdescription()//Prints out program description { cout << "What do you want to start with, enter your number than print enter.\n"; } int choice(int choose)//Allows user to choose what is being converted to. { cout << " 0. Fahrenheit\n"; cout << " 1. Celsius\n"; cin >> choose; return choose; } float c(float fa)//For converting into fahrenheit. { float ce; cout << "Input your celsius vaulue and press\nENTER.\n"; cin >> ce; fa=(1.8*ce)+32; //Formula to convert c to f. return fa; } float f(float ce)//For converting into celsius. { float fa; cout << "Input your fahrenheit vaulue and press\nENTER.\n"; cin >> fa; ce=(fa-32)*(5.0/9.0);//Formula to convert f to c. return ce; } void output(float fa, float ce)//Prints fahrenheit and celsius value to the screen. { clrscr(); cout << "Fahrenheit value is: " << fa << endl; cout << "Celsius value is: " << ce; }



Reply With Quote