add chapter 2
This commit is contained in:
parent
bc81913469
commit
6ce7b718d1
|
@ -0,0 +1,12 @@
|
|||
# include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
string your_name, your_adress;
|
||||
cout << "Enter Your Name" << endl;
|
||||
cin >> your_name;
|
||||
cout << "Enter Your Adress" << endl;
|
||||
cin >> your_adress;
|
||||
cout << "Your Name: " << your_name << endl <<"Your Adress: " << your_adress << endl;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
# include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
int long_value, ma_value;
|
||||
cout << "Enter Long" << endl;
|
||||
cin >> long_value;
|
||||
ma_value = 220 * long_value;
|
||||
cout << "Ma is " << ma_value << endl;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
# include <iostream>
|
||||
using namespace std;
|
||||
void Double_wd (string b, string c);
|
||||
|
||||
int main(){
|
||||
Double_wd ("Three blind mice", "See how they run");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Double_wd (string b, string c){
|
||||
string wd1, wd2, wd3;
|
||||
wd1 = b;
|
||||
wd2 = c;
|
||||
cout << wd1 << endl << wd1 << endl << wd2 << endl << wd2 << endl;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
# include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
int yr_value, mn_value;
|
||||
cout << "Enter Your Eage" << endl;
|
||||
cin >> yr_value;
|
||||
mn_value = 12 * yr_value;
|
||||
cout << "It contains " << mn_value << " Months"<< endl;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
# include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
double ce_value, fa_value;
|
||||
cout << "Enter Celsisus value: ";
|
||||
cin >> ce_value;
|
||||
fa_value = 1.8 * ce_value + 32;
|
||||
cout << ce_value << "degree Celsisus is " << fa_value << " degrees Fahrenheit" << endl;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
# include <iostream>
|
||||
using namespace std;
|
||||
|
||||
int main(){
|
||||
double ly_value, au_value;
|
||||
cout << "Enter the number of light years: ";
|
||||
cin >> ly_value;
|
||||
au_value = int(63240 * ly_value);
|
||||
cout << ly_value << " light years = " << au_value << " astronomical unites" << endl;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
# include <iostream>
|
||||
using namespace std;
|
||||
void time_output(int h, int m);
|
||||
|
||||
int main(){
|
||||
int h, m;
|
||||
cout << "Enter the number of hours: ";
|
||||
cin >> h;
|
||||
cout << "Enter the number of minutes: ";
|
||||
cin >> m;
|
||||
time_output(h,m);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void time_output(int h, int m){
|
||||
cout << "Time: " << h << ":" <<m << endl;
|
||||
}
|
Loading…
Reference in New Issue