Question

Write a C++ program that outputs a table having four columns of temperature values, ordered as follow: Celsius, Fahrenheit, Kplease solve it using c++ coding

0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

#include <iostream>
#include <fstream>
using namespace std;

int main () {
ofstream myfile;
myfile.open ("temperatures.txt");
cout<<"Celsius\tFahr\tKelvin\tRankine\n";
myfile<<"Celsius\tFahr\tKelvin\tRankine\n";
for(int c=0;c<=100;c=c+5)
{
double F=1.8*(double)c+32.0;
double K=(double)c+273.15;
double R=1.8*(double)K;
cout<<c<<"\t"<<F<<"\t"<<K<<"\t"<<R<<"\n";
myfile<<c<<"\t"<<F<<"\t"<<K<<"\t"<<R<<"\n";
}
myfile.close();
return 0;
}

main.cpp- Code Blocks 13.12 Eile Edit iew Search Project Build Debug Fortran woSmith Tools ToolsPlugins DoxyBlocks Settings H​​​​​​​

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
please solve it using c++ coding Write a C++ program that outputs a table having four...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program that displays a table of Celsius temperatures 0 through a number entered by...

    Write a program that displays a table of Celsius temperatures 0 through a number entered by the user and their Fahrenheit equivalents as in the figure below. The formula for converting a Celsius temperature to a Fahrenheit temperature is: F = 9 / 5 * C + 32 where F is the Fahrenheit temperature and C is the Celsius Temperature. Your program must use a 'for' loop. Display all temperatures to one decimal place. Write a program that displays a...

  • Problem Set 2 Variability, Variance and Standard Deviations . Z scores and the Standard Normal Distribution...

    Problem Set 2 Variability, Variance and Standard Deviations . Z scores and the Standard Normal Distribution • Probability and the Normal Distribution Set Version C [Please staple multiple pages together Each question is worth 1 mark unless otherwise noted. The first three questions concerns the following scenario: A researcher studying romantic attraction measures body temperature changes using a very accurate thermometer that registers temperature in degrees Kelvin (0°K = absolute zero, average human adult body temperature: u=310.0°K, O=0.4°K). 30 participants...

  • Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin...

    Temperature Converter Create a temperature conversion program that will convert the following to Fahrenheit: Celsius Kelvin Newton Your program should take a character which represents the temperature to convert from and a value to be converted to using the following specification: C - Celsius K - Kelvin N - Newton In addition your program should take in the following character to exit the program: X - eXit the program The numeric input for your program should be of type double....

  • In java Se8 i am trying to write a program convert temperature between celsius, fahrenheit and...

    In java Se8 i am trying to write a program convert temperature between celsius, fahrenheit and kelvin, but i am stuck at how to return the proper result without chage the frame, and I cnould not figure out how to use those three settemp method. import java. uti1. Arrays public class Temperature different scale names/ public static Stringll scales -Celsius", "Fahrenheit", "Kelvin private double temperature private char scale; public Temperature (double temp temp 273. 15; this. scale-C if (temp <-273....

  • Write a C++ console application that displays a table of Celsius temperatures from 0 through 20...

    Write a C++ console application that displays a table of Celsius temperatures from 0 through 20 and their equivalent Fahrenheit temperature values. The formula for converting from Celsius to Fahrenheit is: [In C++ Please] F==C + 32 Where, C is the temperature value in Celsius, and F is the equivalent temperature in Fahrenheit. Your program must use a loop to display the temperature values.

  • c++ please 2. (50 points) Create a Temperature class that internally stores a temperature in degrees...

    c++ please 2. (50 points) Create a Temperature class that internally stores a temperature in degrees Kelvin as a double. Create mutator functions named setTempKelvin, setTempFahrenheit, and set TempCelsius that take an input temperature in the specified temperature scale (i.e. Kelvin, Fahrenheit, and Celsius, respectively), and convert the temperature to Kelvin, and store that temperature in the class member private variable (only in Kelvin, no other scales). Also, create functions that return the stored temperature in degrees Kelvin, Fahrenheit, or...

  • Using the latest version of Java JDK, Create a version of this TempConverter program to convert...

    Using the latest version of Java JDK, Create a version of this TempConverter program to convert from Fahrenheit to Kelvin. Read the Fahrenheit temperature from the user. public class TempConverter { //----------------------------------------------------------------- // Computes the Fahrenheit equivalent of a specific Celsius // value using the formula F = (9/5)C + 32. //----------------------------------------------------------------- public static void main (String[] args) { final intBASE = 32; final double CONVERSION_FACTOR = 9.0 / 5.0; double fahrenheitTemp; intcelsiusTemp= 24; // value to convert fahrenheitTemp= celsiusTemp*...

  • Question 2 Write a program to generate a table of conversions from Fahrenheit to Celsius for...

    Question 2 Write a program to generate a table of conversions from Fahrenheit to Celsius for values from 0 degrees F to 100 degrees F. Print a line in the table for each 5-degree change. Use a while loop in your solution. 1) re,-(TCF)-32) x 5/9 Write a program to generate a table of conversions from Fahrenheit to Kelvin for values from 0 degrees F to 200 degrees F. Allow the user to enter the increment in degrees Fahrenheit between...

  • General overview This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin....

    General overview This program will convert a set of temperatures from Fahrenheit to Celsius and Kelvin. Your program will be reading in three double values. The first values are starting and ending temperatures. The third value is the increment value. There is no prompt for the input. There is an error message that can be displayed. This is discussed later. You need to display output for all of the values between the starting and ending values. First two values are...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT