-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstone.cpp
40 lines (36 loc) · 833 Bytes
/
stone.cpp
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
// stone.cpp -- user-defined conversions
// compile with stonewt.cpp
#include <iostream>
using std::cout;
#include "stonewt.h"
void display(const Stonewt st, int n);
int main()
{
Stonewt pavarotti = 260;
Stonewt wolfe(285.7);
Stonewt taft(21.8);
cout << "The tenor weighted ";
pavarotti.show_stn();
cout << "The detective weighted ";
wolfe.show_stn();
cout << "The President weighted ";
taft.show_lbs();
pavarotti = 265.8;
taft = 325;
cout << "After dinner, the tenor weighted ";
pavarotti.show_stn();
cout << "After dinner, the President weighted ";
taft.show_lbs();
display(taft, 2);
cout << "The wrestler weighted even more.\n";
display(422, 2);
cout << "No stone left unearned\n";
return 0;
}
void display (const Stonewt st, int n)
{
for (int i = 0; i < n; i++) {
cout << "Wow! ";
st.show_stn();
}
}