So i was wondering if anyone could help me out on my homework assignment
So far were just starting this is week 4. I need assistance trying to convert fahrenheit to kelvin
this is what i have so far
My comments describe my error but if you cant read them for some reason. it // calculation has been seperated into parts indiviually because the result being output is incorrect
// the result is always 273 original formula was kelvin = (fah - 32) * (5 / 9) + 273.15
Also do you guys know of a great forum that deals with C++/ assisting in homework C++ related?
i think i am going to need C++ friends in order to succeed in this class.
So far were just starting this is week 4. I need assistance trying to convert fahrenheit to kelvin
this is what i have so far
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// originally was just fah and kelvin. extraa kelvins were added in order to attempt to gain correct output.
// output remains 273 which is incorrect
float fah, kelvin0, kelvin1, kelvin2;
//fix and setp so it can round to ones decimal places
cout << fixed;
cout << setprecision(1);
cout << "== Fahrenheit to Kelvin converter ==" << endl;
cout <<"Enter Fahrenheit:" << endl;
cin >> fah ;
// calculation has been seperated into parts indiviually because the result being output is incorrect
// the result is always 273 original formula was kelvin = (fah - 32) * (5 / 9) + 273.15
kelvin0 = (fah - 32);
kelvin1 = kelvin0 * (5/9);
kelvin2 = kelvin1 + 273.15;
cout << "Kelvin: " << kelvin2 << endl;
}
My comments describe my error but if you cant read them for some reason. it // calculation has been seperated into parts indiviually because the result being output is incorrect
// the result is always 273 original formula was kelvin = (fah - 32) * (5 / 9) + 273.15
Also do you guys know of a great forum that deals with C++/ assisting in homework C++ related?
i think i am going to need C++ friends in order to succeed in this class.
My Computer
- Computer type
- PC/Desktop
- Computer Manufacturer/Model Number
- Gateway / Slight Modifications
- OS
- Windows 8 64 bit PRO
- CPU
- AMD Phenom X4 9100e
- Motherboard
- Gateway RS780
- Memory
- 2GB X2 DDR2
- Graphics Card(s)
- Sapphire HD 6850
- Sound Card
- Integrated
- Monitor(s) Displays
- Gateway 19" + Dell 19"
- Screen Resolution
- 1440X900 sometimes 2880 by 900
- Hard Drives
- WD 80GB
WD 640GB
WD 1,000GB
- PSU
- Antec BP 550watts
- Case
- Antec 300
- Cooling
- Stock Cooling
- Keyboard
- Saitek Eclipse II
- Mouse
- Gigabyte GM-M6800
- Internet Speed
- D: 30Mbps U:4Mbps
- Antivirus
- Avast version 8
- Browser
- Internet Explorer ver 10 64 bit
- Other Info
- This is my work computer.
I have another laptop running Windows 7 64 bit.
Another PC running Windows 8 64 bit pro.
Total of 3