I am having problems with this assignment. The first part is as follows, which I
ID: 3538137 • Letter: I
Question
I am having problems with this assignment. The first part is as follows, which I have done and shown below:
Construct a class named TemperatureData using struct. This class should contain three data members: a string named scale, a double named temperature, and an int named year. The scale should be Fahrenheit, Celsius or Kelvin.
#include <iostream>
using namespace std;
struct TemperatureData {
string scale;
double temperature=0.0;
int year=0;
}
The next part is as follows: Write a first application that creates a TemperatureData using stdin, and then returns the temperature on stdout in the three aforementioned formats.
I am stuck on this part. Not exactly sure where to begin. any input is greatly appreciated.
Explanation / Answer
//conversion formulas are: //c=k-273 //f=(9/5)c+32 #include struct TemperatureData { char scale; double temperature; int year; }; void main() { TemperatureData td; double fah,celsius,kelvin; coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.