~~~~~~~~~~~Header~~~~~~~~~~~~~~~~

#ifndef GRADE_H
#define GRADE_H

using namespace std;

class Temp {
public:
temp_c();
void set_temp(int temp);
int get_temp();

private: int temp_t;
};



#endif


~~~~~~~~~~~~~~~IMPLMENTATION~~~~~~~~~~~~~~~~

#include "Header.h"

using namespace std;

Temp::temp_c() {};

void Temp::set_temp(int temp) {
temp_t = temp;

}

int Temp::get_temp() {

return temp_t;
}

~~~~~~~MAIN~~~~~~~~~~~~~~~~

#include <iostream>
using namespace std;
#include "Header.h"
int main() {

Temp mytemp;

cout<<mytemp.get_temp();





}

Reply · Report Post