-
Notifications
You must be signed in to change notification settings - Fork 0
/
weight.hpp
86 lines (71 loc) · 1.47 KB
/
weight.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef WEIGHT_HPP
#define WEIGHT_HPP
#include <iostream>
#include "input.hpp"
using namespace std;
//Classe que realiza as conversões de peso
class Weight:public Input
{
public:
void milligm_gm();
void gm_milligm();
void gm_kg();
void kg_gm();
void kg_mton();
void mton_kg();
void pound_kg();
void kg_pound();
void gm_pound();
void pound_gm();
};
void Weight::milligm_gm()
{
cout<<"\n miligrama= ";cin>>i;
cout<<"\n grama= "<<i*.001;
}
void Weight::gm_milligm()
{
cout<<"\n grama= "; cin>>i;
cout<<"\n miligrama= "<<i*1000;
}
void Weight::pound_kg()
{
cout<<"\n libra= "; cin>>i;
cout<<"\n kilograma= "<<i*.45359;
}
void Weight::gm_kg()
{
cout<<"\n Grama= ";cin>>i;
cout<<"\n kilograma= "<<i*.001;
}
void Weight::kg_gm()
{
cout<<"\n kilograma= ";cin>>i;
cout<<"\n Grama= "<<i*1000;
}
void Weight::kg_pound()
{
cout<<"\n kilograma= ";cin>>i;
cout<<"\n libra= "<<2.20462*i;
}
void Weight::gm_pound()
{
cout<<"\n grama= "; cin>>i;
cout<<"\n libra= "<<i*.0022;
}
void Weight::pound_gm()
{
cout<<"\n libra= "; cin>>i;
cout<<"\n grama= "<<i*453.59237;
}
void Weight::kg_mton()
{
cout<<"\n kilograma= ";cin>>i;
cout<<"\n tonelada= "<<i*.001;
}
void Weight::mton_kg()
{
cout<<"\n tonelada= "; cin>>i;
cout<<"\n kilograma= "<<i*1000;
}
#endif