#include <stdio.h>
#include <conio.h>
#include <iostream.h>
class conv
{
private:
float Marmor[2];
float Sten[2];
float Tra[2];
float ipsos;
float mikos;
float platos;
int choice;
public:
void my_init()
{
Marmor[0]=2.7;
Marmor[1]=20;
Sten[0]=2.6;
Sten[1]=15;
Tra[0]=0.6;
Tra[1]=7;
}
void my_get()
{
cout<<"Blockkalkylatorn "<<char(174)<<endl;
cout<<endl;
cout<<"Dose ipsos : ";
cin>>ipsos;
cout<<endl;
cout<<"Dose mikos : ";
cin>>mikos;
cout<<endl;
cout<<"Dose platos : ";
cin>>platos;
cout<<endl;
cout<<endl;
cout<<"(1)Marmor"<<endl;
cout<<"(2)Sten"<<endl;
cout<<"(3)Tra"<<endl;
cout<<"Dose noumero : ";
cin>>choice;
cout<<endl;
cout<<endl;
}
my_results()
{
int emv;
cout<<"Ilika Emvadon(dm"<<char(179)<<") Baros(kg)
Timi(kr)"<<endl;
cout<<"------ ---------- -------- -------"<<endl;
emv=mikos*platos*ipsos;
if(choice==1)
cout<<"Marmor "<<emv<<" "<<emv*Marmor[0]<<"
"<<emv*Marmor[1]<<endl;
if(choice==2)
cout<<"Sten "<<emv<<" "<<emv*Sten[0]<<"
"<<emv*Sten[1]<<endl;
if(choice==3)
cout<<"Tra "<<emv<<" "<<emv*Tra[0]<<"
"<<emv*Tra[1]<<endl;
cout<<endl;
cout<<endl;
cout<<"Blockfixarna AB "<<char(169)<<" 2005"<<endl;
cout<<"Dimiourgithike apo ton Giwrgo"<<endl;
}
};
main()
{
class conv rov1;
rov1.my_init();
rov1.my_get();
rov1.my_results();
getch();
}
Sin ta parakato lathoi:
3 C:\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31, from C:\Documents and Settings\George\Desktop\ergasia.cpp In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31, from C:\Documents and Settings\George\Desktop\ergasia.cpp
32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.
10 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\228' in program
11 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\246' in program
11 C:\Documents and Settings\George\Desktop\ergasia.cpp `h' does not name a type
12 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\228' in program
12 C:\Documents and Settings\George\Desktop\ergasia.cpp `l' does not name a type
22 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\228' in program
23 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\228' in program
30 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\246' in program
33 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\228' in program
48 C:\Documents and Settings\George\Desktop\ergasia.cpp ISO C++ forbids declaration of `my_results' with no type
50 C:\Documents and Settings\George\Desktop\ergasia.cpp missing terminating " character
51 C:\Documents and Settings\George\Desktop\ergasia.cpp missing terminating " character
53 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\228' in program
53 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\246' in program
55 C:\Documents and Settings\George\Desktop\ergasia.cpp missing terminating " character
56 C:\Documents and Settings\George\Desktop\ergasia.cpp missing terminating " character
58 C:\Documents and Settings\George\Desktop\ergasia.cpp missing terminating " character
59 C:\Documents and Settings\George\Desktop\ergasia.cpp missing terminating " character
61 C:\Documents and Settings\George\Desktop\ergasia.cpp stray '\228' in program
61 C:\Documents and Settings\George\Desktop\ergasia.cpp missing terminating " character
62 C:\Documents and Settings\George\Desktop\ergasia.cpp missing terminating " character
C:\Documents and Settings\George\Desktop\ergasia.cpp In member function `void conv::my_get()':
30 C:\Documents and Settings\George\Desktop\ergasia.cpp `h' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
30 C:\Documents and Settings\George\Desktop\ergasia.cpp expected `;' before "jd"
33 C:\Documents and Settings\George\Desktop\ergasia.cpp `l' undeclared (first use this function)
33 C:\Documents and Settings\George\Desktop\ergasia.cpp expected `;' before "ngd"
C:\Documents and Settings\George\Desktop\ergasia.cpp In member function `int conv::my_results()':
51 C:\Documents and Settings\George\Desktop\ergasia.cpp `kr' undeclared (first use this function)
51 C:\Documents and Settings\George\Desktop\ergasia.cpp `Pris' undeclared (first use this function)
52 C:\Documents and Settings\George\Desktop\ergasia.cpp expected `;' before "cout"
53 C:\Documents and Settings\George\Desktop\ergasia.cpp `l' undeclared (first use this function)
53 C:\Documents and Settings\George\Desktop\ergasia.cpp expected `;' before "ngd"
57 C:\Documents and Settings\George\Desktop\ergasia.cpp expected primary-expression before "if"
57 C:\Documents and Settings\George\Desktop\ergasia.cpp expected `;' before "if"