Martin Sarlina
(2.1) #include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float a;
float b;
float c;
float jumlah;
raptor_prompt_variable_zzyz ="Masukkan Nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> a;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> b;
raptor_prompt_variable_zzyz ="Masukkan Nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> c;
jumlah =a+b+c;
cout << "Jumlah" << endl;
return 0;
}
(2.2) #include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float hasil;
float a;
float b;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout <<"raptor_prompt_variable_zzyz"<< endl;
cin >>a;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout <<"raptor_prompt_variable_zzyz"<< endl;
cin >>b;
hasil = a*b;
cout<<"Haislnya = "<<hasil<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
(2.3) #include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float m;
float inci;
float cm;
cout<<"mencari hasil dari cm*inci"<<endl<<endl;
cout <<"masukkan nilai m = ";
cin >> m;
cm = m*100;
cout<<"hasil m ke cm-nya = "<<cm = m*100<<endl;
cout<<"hasil m ke inci-nya = "<<inci = m*100/2.54<<endl<<endl;
cout <<"hasil cm*inci = "<<cm*inci<< endl;
system("PAUSE");
return EXIT_SUCCESS;
}
(2.4) #include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float r;
float n;
float m;
float q;
raptor_prompt_variable_zzyz ="Masukkan Nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> q;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> n;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> r;
m =q*n*r;
// cout<<"m="q"*"n"*"r<< endl;
//system ("PAUSE")
return 0;
}
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float a;
float b;
float c;
float jumlah;
raptor_prompt_variable_zzyz ="Masukkan Nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> a;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> b;
raptor_prompt_variable_zzyz ="Masukkan Nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> c;
jumlah =a+b+c;
cout << "Jumlah" << endl;
return 0;
}
(2.2) #include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float hasil;
float a;
float b;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout <<"raptor_prompt_variable_zzyz"<< endl;
cin >>a;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout <<"raptor_prompt_variable_zzyz"<< endl;
cin >>b;
hasil = a*b;
cout<<"Haislnya = "<<hasil<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
(2.3) #include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float m;
float inci;
float cm;
cout<<"mencari hasil dari cm*inci"<<endl<<endl;
cout <<"masukkan nilai m = ";
cin >> m;
cm = m*100;
cout<<"hasil m ke cm-nya = "<<cm = m*100<<endl;
cout<<"hasil m ke inci-nya = "<<inci = m*100/2.54<<endl<<endl;
cout <<"hasil cm*inci = "<<cm*inci<< endl;
system("PAUSE");
return EXIT_SUCCESS;
}
(2.4) #include <iostream>
#include <string>
using namespace std;
int main()
{
string raptor_prompt_variable_zzyz;
float r;
float n;
float m;
float q;
raptor_prompt_variable_zzyz ="Masukkan Nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> q;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> n;
raptor_prompt_variable_zzyz ="Masukkan nilai";
cout << raptor_prompt_variable_zzyz << endl;
cin >> r;
m =q*n*r;
// cout<<"m="q"*"n"*"r<< endl;
//system ("PAUSE")
return 0;
}