C Main method given in picture TempConversion Needs to imple
C++ Main method given in picture TempConversion
(Needs to implement temp class and other uml representations)
Implement the temperature class depicted by the following UML representation. Temperature + CELSIUS : const int = 1; + FAHRENHEIT : const int = 2; + KELVIN : const int = 3; - celsiusfloat +Temperature(degrees: float, system: int) +getCelsius0 float; + getFahrenheit0 float; +getKelvin0 float; Your main program should look similar to this: 2 main.cpp 4Created on: Oct 5, 2016 Author: Leune 7 8 9 #include #include \"Temperature . h\" 10 int main() float temp = 68.0; 12 13 14 15 16 17 18 std::coutSolution
main.cpp
#include<iostream>
 #include \"temperature.h\"
using namespace std;
int main()
 {
     Temperature t(68,2);
     float temp=68;
       
     std::cout<<\"In celsius\"<<t.getCelsius(temp,2)<<std::endl;
     std::cout<<\"In kelvin\"<<t.getKelvin(temp,2)<<std::endl;
}
temperature.cpp
#include <iostream>
 #include \"temperature.h\"
 using namespace std;
Temperature::Temperature(float d,int s):degree(d),sys(s)
 {
     if (s=1)
     {
         getFahrenheit(d,s);
         getKelvin(d,s);
     }
   
     else if(s=2)
     {
         getCelsius(d,s);
         getKelvin(d,s);
     }
   
     else if(s=3)
     {
         getCelsius(d,s);
         getFahrenheit(d,s);
     }
   
 }
int CELSIUS()
 {
     int sys;
     sys=1;
     return sys;
 }
int FAHRENHEIT()
 {
     int sys;
     sys=2;
     return sys;
 }
int KELVIN()
 {
     int sys;
     sys=3;
     return sys;
 }
 float Temperature::getCelsius(float t, int sys)
 {
     float degreec;
     if (sys=2)
       float degreec=(t-32)/1.8;  
     else if (sys=3)
       float degreec=t-273.15;
   
     return degreec;
 }
float Temperature::getFahrenheit(float t, int sys)
 {
     float degreef;
     if (sys=1)
       float degreef=(t*1.8)+32;  
     else if (sys=3)
       float degreef=(t*9/5)-459.67;
   
     return degreef;
 }
float Temperature::getKelvin(float t, int sys)
 {
     float degreek;
     if (sys=1)
       float degreek=(t+273.15);  
     else if (sys=2)
       float degreek=(t+459.67)*(5/9);
   
     return degreek;
 }
temperature.h
class Temperature {
public:
       double degree;
       const int sys;
       Temperature(float degree,int sys);
                       
        float getCelsius(float degree,int s);
       float getFahrenheit(float degree, int sys);
       float getKelvin(float degree, int sys);
       int CELSIUS();
       int FAHRENHEIT();
       int KELVIN();
};



