Answer to Question #267026 in C++ for pakie

Question #267026

The formula below decribes how to convert a temperature on the Fahrenheit scale to a temperature on the Kelvin scale.

TempK = (TempF − 32) × 5/9 + 273.15

Using the variables below Write one line of code to implement the formula


// Kelvin temperature

float TempK;

// Fahrenheit temperature

float TempF = 72; 


//One line of code to calculate temperature in Kelvin


1
Expert's answer
2021-11-16T07:44:55-0500
#include <iostream>
#include <iomanip>
using namespace std;


int main(){
	// Kelvin temperature
	float TempK;
	// Fahrenheit temperature
	float TempF = 72; 
	//One line of code to calculate temperature in Kelvin
	TempK = (TempF - 32) * 5/9 + 273.15;
	cout<<"Temperature in Fahrenheit is: "<<TempF<<"\n\n";
	cout<<"Temperature in Kelvin is: "<<TempK<<"\n\n";


	cin>>TempK;
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS