Create your own module, named convert temp Last First, which defines the followi
ID: 3686631 • Letter: C
Question
Create your own module, named convert temp Last First, which defines the following temperature conversion functions: (SUBMIT YOUR MODULE AS WELL) Write a program that utilizes the functions you created in your module. Your program should read user input from the command-line for C, F, and K values. If an IndexError occurs print the following error message: 'Please provide the values for C. F, and K on the command line.' If a ValueError occurs print the following error message: 'C, F, and K must be pure numbers.' If C less than -273, or F less than -460, or K less than 0 print the respective error message stating that 'C = # is not possible.', etc. Assuming that the user properly enters data for C, F, and K, your output should look as follows. python Lasl_First_Assignment_5.3.py 100 32 5 data entered as follows: C F KExplanation / Answer
Solution: Please follow these program as shown in below
#include <iostream>
class one {
public:
one(int c1,int f1) : c(c1), f(f1) {}
int c,f,k;
void g()
{ std::cout << "one "; }
};
class two {
public:
two(double a1,double b1) : a(a1), b(b1) {}
double a,b;
void g() { std::cout << "two "; }
};
template<class X, typename Y>
class three : public X {
public:
three(Y c, Y f,Y k) : X(c,f,k) {}
void f()
{
X::g();
std::cout << ( X::c + X::f + X::k ) << std::endl;
}
};
int main()
{
three<one,int> k1(1,2);
three<two,double> k2(5.3,35.7);
k1.f();
k2.f();
return 0;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.