Overtime
2011-09-12 22:30:27
Not due till next Wednesday, but I love being ahead of everyone in the class.
As it is, everyone knows I got some knowledge under my belt on this stuff so everyone is turning to me for questions.
I feel like a boss :spot:
As it is, everyone knows I got some knowledge under my belt on this stuff so everyone is turning to me for questions.
I feel like a boss :spot:
/*
// Name: James Luna
// ID #:
// Date: September 12, 2011
//
// CSCI / CMPE 1370.03
// Assignment 1: Fahrenheit to Celsius converter
// Due Date: September 21, 2011
//
// This program converts a temperature in Fahrenheit to Celsius
// The formula is: C = 5 / 9 (F - 32)
*/
/* Our includes we will be using for the program
*/
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
/* Our doubles we will be using, so we can use them later.
*/
double celsius, fahrenheit;
/* My introduction to the user using my program.
*/
cout << " *James Luna's Fahrenheit to Celsius Converter*"
<< endl
<< endl
<< endl;
/* Asking the user to input his data in Fahrenheit
*/
cout << " Enter a temperature in Fahrenheit: ";
cin >> fahrenheit;
cout << endl;
/* The forumula to use to get our celsius degree
I added a .0 so that it can take it as a double.
*/
celsius = 5.0 /9 * (fahrenheit - 32);
/* So we can set how many deciamls we want it to show to the right
*/
cout << setprecision(1) << fixed;
/* This is going to tell the user what data he inputed then display the
degree in celsius.
*/
cout << " " << fahrenheit << " degrees Fahrenheit is " << celsius << " degrees Celsius. "
<< endl
<< endl
<< endl;
/* My closing statement, thanking the user for trying out my program
*/
cout << " Thank You for using my Fahrenheit to Celsius converter. "
<< endl
<< endl
<< endl;
/* Asking the console to pause so the user can see the data. */
system ("Pause");
return 0;
}