Modul 2.1
http://www.youtube.com/watch?v=y39vNeJJmjo&feature=youtu.be
//Modul 2-1
// Tipe data Dasar.cpp
// Nama : Wulan Kandiani Kusumah Wardani
// NRP : 49013036
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout <<"=============================================\n";
cout <<" BELAJAR TIPE DATA \n";
cout <<"=============================================\n";
int X;
X = 10;
cout <<"Contoh Nilai Tipe Bilangan Bulat X = "<< X<< endl<<endl;
double Y;
Y = 123.134;
cout<< "Contoh Nilai Tiipe Bilangan Real Y =" << Y << endl << endl;
char Karakter ='A';
char* Teks ="Kata";
char TEKS [39] = "Teks dengan batas sebanyak 39 karakter";
cout << Karakter <<endl;
cout << Teks << endl;
cout << TEKS << endl << endl;
system ("pause");
return (0);
}
Modul 2.2
http://www.youtube.com/watch?v=-i9Gtn6e4NQ&feature=youtu.be
// MODUL 2-2
// Konversi Tipe Data
// Nama : Wulan Kandiani Kusumah Wardani NIM : 49013036
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
char Karakter = 'A';
cout << "Karakter A = " << Karakter << endl;
cout << "Nilai ASCII = "<< (int) Karakter << endl;
system ("pause");
return 0;
}
Modul 2.3
http://www.youtube.com/watch?v=kT_sk0Y2Sc4
//MODUL 2-3
// Konstanta
// Nama : Wulan Kandiani Kusumah Wardani
// NRP : 49013036
#include <iostream>
#include <stdlib.h>
using namespace std;
const int MAX = 5;
int main()
{
int A[MAX];
for (int C = 0; C < MAX ; C++)
{
A[C] = C *10;
}
for (int c = 0; c <MAX; c++)
{
std::cout << A [c] << endl;
}
system("pause");
return 0;
}
Modul 2.4
http://www.youtube.com/watch?v=sHMoGRb5UYQ&feature=youtu.be
//Modul 2-4
//Variabel Global & Lokal
//Nama : Wulan Kandiani Kusumah Wardani
//NIM : 49013036
#include <iostream>
#include <stdlib.h>
using namespace std;
int A ;// Sebagai Variabel Global karena berada di luar main
int main ()
{
A = 100;
cout<< "Nilai Variabel A = "<< A << endl <<endl;
int B;//Sebagai Variabel Lokal Karena berada di salam main
B = 50;
cout << "Nilai Variabel B = " << B << endl << endl;
system ("pause");
return 0;
}
Modul 2.5
http://www.youtube.com/watch?v=f_X9jVTHCL4
// Modul 2-5 : Latihan Tipe Data
// Limit.cpp
// Nama : Wulan Kandiani Kusumah Wardani
// NRP : 49013036
#include <iostream>
#include <limits>
using namespace std;
int main()
{
std:: cout << " Praktikum Pemrograman Visual C++";
std:: cout << " \nDikerjakan Oleh : Wulan Kandiani Kusumah Wardani\n";
std:: cout << " \nNRP : 49013036 \n";
std:: cout << "=================================\n";
std:: cout << " TIPE DATA \n";
std:: cout << "=================================\n ";
std:: cout << " minimum char = " << CHAR_MIN << endl;
std:: cout << " maximum char = " << CHAR_MAX << endl;
std:: cout << " minimum signed char = "<<SCHAR_MIN<<endl;
std:: cout << " maximum signed char = "<<SCHAR_MAX<<endl;
std:: cout << " maximum unsigned char ="<<UCHAR_MAX<<endl;
std:: cout << " minimum short = " << SHRT_MIN << endl;
std:: cout << " maximum short = " << SHRT_MAX << endl;
std:: cout << " minimum int = " << INT_MIN << endl;
std:: cout << " maximum int = " << INT_MAX << endl;
std:: cout << " minimum long = " << LONG_MIN << endl;
std:: cout << " maximum long = " << LONG_MAX << endl;
std:: cout << " maximum unsigned short="<<USHRT_MAX<<endl;
std:: cout << " maximum unsigned = " << UINT_MAX << endl;
std:: cout << " maximum unsigned long ="<<ULONG_MAX<<endl;
system ("pause");
return 0;
}
http://www.youtube.com/watch?v=y39vNeJJmjo&feature=youtu.be
//Modul 2-1
// Tipe data Dasar.cpp
// Nama : Wulan Kandiani Kusumah Wardani
// NRP : 49013036
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
cout <<"=============================================\n";
cout <<" BELAJAR TIPE DATA \n";
cout <<"=============================================\n";
int X;
X = 10;
cout <<"Contoh Nilai Tipe Bilangan Bulat X = "<< X<< endl<<endl;
double Y;
Y = 123.134;
cout<< "Contoh Nilai Tiipe Bilangan Real Y =" << Y << endl << endl;
char Karakter ='A';
char* Teks ="Kata";
char TEKS [39] = "Teks dengan batas sebanyak 39 karakter";
cout << Karakter <<endl;
cout << Teks << endl;
cout << TEKS << endl << endl;
system ("pause");
return (0);
}
Modul 2.2
http://www.youtube.com/watch?v=-i9Gtn6e4NQ&feature=youtu.be
// MODUL 2-2
// Konversi Tipe Data
// Nama : Wulan Kandiani Kusumah Wardani NIM : 49013036
#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
char Karakter = 'A';
cout << "Karakter A = " << Karakter << endl;
cout << "Nilai ASCII = "<< (int) Karakter << endl;
system ("pause");
return 0;
}
Modul 2.3
http://www.youtube.com/watch?v=kT_sk0Y2Sc4
//MODUL 2-3
// Konstanta
// Nama : Wulan Kandiani Kusumah Wardani
// NRP : 49013036
#include <iostream>
#include <stdlib.h>
using namespace std;
const int MAX = 5;
int main()
{
int A[MAX];
for (int C = 0; C < MAX ; C++)
{
A[C] = C *10;
}
for (int c = 0; c <MAX; c++)
{
std::cout << A [c] << endl;
}
system("pause");
return 0;
}
Modul 2.4
http://www.youtube.com/watch?v=sHMoGRb5UYQ&feature=youtu.be
//Modul 2-4
//Variabel Global & Lokal
//Nama : Wulan Kandiani Kusumah Wardani
//NIM : 49013036
#include <iostream>
#include <stdlib.h>
using namespace std;
int A ;// Sebagai Variabel Global karena berada di luar main
int main ()
{
A = 100;
cout<< "Nilai Variabel A = "<< A << endl <<endl;
int B;//Sebagai Variabel Lokal Karena berada di salam main
B = 50;
cout << "Nilai Variabel B = " << B << endl << endl;
system ("pause");
return 0;
}
Modul 2.5
http://www.youtube.com/watch?v=f_X9jVTHCL4
// Modul 2-5 : Latihan Tipe Data
// Limit.cpp
// Nama : Wulan Kandiani Kusumah Wardani
// NRP : 49013036
#include <iostream>
#include <limits>
using namespace std;
int main()
{
std:: cout << " Praktikum Pemrograman Visual C++";
std:: cout << " \nDikerjakan Oleh : Wulan Kandiani Kusumah Wardani\n";
std:: cout << " \nNRP : 49013036 \n";
std:: cout << "=================================\n";
std:: cout << " TIPE DATA \n";
std:: cout << "=================================\n ";
std:: cout << " minimum char = " << CHAR_MIN << endl;
std:: cout << " maximum char = " << CHAR_MAX << endl;
std:: cout << " minimum signed char = "<<SCHAR_MIN<<endl;
std:: cout << " maximum signed char = "<<SCHAR_MAX<<endl;
std:: cout << " maximum unsigned char ="<<UCHAR_MAX<<endl;
std:: cout << " minimum short = " << SHRT_MIN << endl;
std:: cout << " maximum short = " << SHRT_MAX << endl;
std:: cout << " minimum int = " << INT_MIN << endl;
std:: cout << " maximum int = " << INT_MAX << endl;
std:: cout << " minimum long = " << LONG_MIN << endl;
std:: cout << " maximum long = " << LONG_MAX << endl;
std:: cout << " maximum unsigned short="<<USHRT_MAX<<endl;
std:: cout << " maximum unsigned = " << UINT_MAX << endl;
std:: cout << " maximum unsigned long ="<<ULONG_MAX<<endl;
system ("pause");
return 0;
}
Tidak ada komentar:
Posting Komentar