SlideShare a Scribd company logo
1 of 11
TUGAS PRAKTIKUKM MICROSOFT VISUAL STUDIO PEMROGRAMAN C++
DENDI RIADI : TEKNIK KOMPUTER KARYAWAN SEMESTER 4
/* =========================================================
Program Pertama microsoft visual studio 2010
Modul 1
Nama : Dendi Riadi
=========================================================*/
#include <iostream> //preprosesor
int main() // fungsi main
{
std::cout << "Ini adalah pertama sayan";
std::cout << "Dengan menggunakan Microsoft Visual Studio C++.n";
return 0;
}
// modul 2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << "ini program kedua saya n";
std::cout << "Menggunakan visual C++." << std::endl;
return 0;
}
//modul 1-3
#include <iostream>
using namespace std;
int main()
{
char tampilkan[1];
char panjang_data[50];
cout << "================================================ n";
cout << " BELAJAR PEMROGRAMAN C++ n";
cout << "================================================ n";
cout << " NAMA : ";
cin.getline (panjang_data,50);
cout << " JURUSAN : Teknik Komputer POLITEKNIK PAJAJARAN " <<endl;
cin.getline(tampilkan,1);
return (0);
}
/* Modul 1.4
Belajar Syntax error
======================================= */
#include <iostream>
using namespace std;
int main()
{
cout << "+++++++++++++++++++++++++++++++++++++++++++ n";
cout << " Memepelajari Syntax errorr n";
cout << "+++++++++++++++++++++++++++++++++++++++++++ n";
cout << " Syntax error adalah kesalahan n";
cout << " Jangan lupa untuk melakukan perintah n";
cout << " Clean Solution yang berada pada n";
cout << " menu Build, sebelum mengkompilasi n";
cout << " program Microsoft Visual Studio C++ n";
return (0);
}
// modul 1-5
// limit.cpp
#include <iostream>
#include <limits>
using namespace std;
int main()
{
cout << " TIPE DATA n";
cout << "===============================n";
cout << " minimum char = " << CHAR_MIN << endl;
cout << " maximum char = " << CHAR_MAX << endl;
cout << " minimum signed char = " << SCHAR_MIN << endl;
cout << " maximum signed char = " << SCHAR_MAX << endl;
cout << " maximum unsigned char = " << UCHAR_MAX << endl;
cout << " minimum short = " << SHRT_MIN << endl;
cout << " maximum short = " << SHRT_MAX << endl;
cout << " minimum int = " << INT_MIN << endl;
cout << " maximum int = " << INT_MAX << endl;
cout << " minimum long = " << LONG_MIN << endl;
cout << " maximum long = " << LONG_MAX << endl;
cout << " maximum unsigned short="<<USHRT_MAX<<endl;
cout << " maximum unsigned = " << UINT_MAX << endl;
cout << " maximum unsigned long ="<<ULONG_MAX<<endl;
return (0);
}
// Modul 2-1
// Tipe data dasar.cpp
#include <iostream>
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.123;
cout << "Contoh Nilai Tipe Bilangan Riil 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;
return (0);
}
//Modul 2-2
//Konversi type data
#include <iostream>
using namespace std;
int main()
{
char Karakter = 'D';
cout << "Karakter D = "
<< Karakter
<< endl;
cout << "Nilai ASCII = "
<< (int) Karakter
<< endl;
return (0);
}
// Modul 2-3
// Konstanta
#include <iostream>
using namespace std;
const int MAX = 10;
int main()
{
int A[MAX];
for (int C = 0; C < MAX; C++)
{
A[C] = C * 7;
}
for (int c = 0; c < MAX; c++)
{
cout << A [c] << endl;
}
return (0);
}
// modul 2-4
// variabel global & lokal
#include <iostream>
using namespace std;
int A;
int main()
{
A = 10;
cout << " Nilai variabel A = "
<< A
<< endl
<< endl;
int B;
B = 300;
cout << " Nilai Variabel B = "
<< B
<< endl
<< endl;
return (0);
}
//Modul 3-1
//Operator Assignment
#include <iostream>
using namespace std;
int main()
{
int a,b;
a = 20;
b = 100;
a = b;
b = 7;
cout << "a = ";
cout << a;
cout << endl;
cout << "b = ";
cout << b;
cout << endl;
return (0);
}
// modul 3-2
// operator unary
#include <iostream>
using namespace std;
int main()
{
int e,g;
double f,h;
e = +8;
f = -3.14;
cout << "Nilai e : " << e << endl;
cout << "Nilai f : " << f << endl;
g = -e;
h = -f;
cout << "Nilai g : " << g << endl;
cout << "Nilai h : " << h << endl;
return (0);
}
// modul 3-3
// increment
#include <iostream>
using namespace std;
int main()
{
int i,j;
i = 5;
cout << "Nilai i awal : " << i << endl;
cout << "Nilai ++i : " << ++i << endl;
cout << "Nilai i akhir : " << i << endl;
cout << 'n';
j = 10;
cout << "Nilai j awal : " << j << endl;
cout << "Nilai ++j : " << ++j << endl;
cout << "Nilai j akhir : " << j << endl;
cout << 'n';
return (0);
}
// modul 3-4
// decrement
#include <iostream>
using namespace std;
int main()
{
int k;
float l;
k = 100;
l = 10.5;
cout << "Nilai k awal : " << k << endl;
cout << "Nilai --k : " << --k << endl;
cout << "Nilai k akhir : " << k << endl;
cout << 'n';
cout << "Nilai l awal : " << l << endl;
cout << "Nilai l-- : " << l-- << endl;
cout << "Nilai l akhir : " << l << endl;
return (0);
}
//modul 4-1
//operator aritmatika
#include <iostream>
using namespace std;
int main()
{
cout << "2 + 3 = "
<< 2 + 3
<< endl << endl;
cout << "10 - 5 = "
<< 10 - 5
<< endl << endl;
cout << "4 x 3 = "
<< 4 * 3
<< endl << endl;
cout << "4 / 2 = "
<< 4 / 2
<< endl << endl;
cout << "10 % 3 = "
<< 10 % 3
<< endl << endl;
return (0);
}
// modul 4-2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
std::cout << " OPERASI OPERATOR LOGIKA n";
cout << "n Tabel Kebenaran operator AND n";
cout << " 1 && 1 = " << (1 && 1) << endl;
cout << " 1 && 0 = " << (1 && 0) << endl;
cout << " 0 && 1 = " << (0 && 1) << endl;
cout << " 0 && 0 = " << (0 && 0) << endl;
cout << "n Tabel Kebenaran operator OR n";
cout << " 1 || 1 = " << (1 || 1) << endl;
cout << " 1 || 0 = " << (1 || 0) << endl;
cout << " 0 || 1 = " << (0 || 1) << endl;
cout << " 0 || 0 = " << (0 || 0) << endl;
cout << "n Tabel Kebenaran operator NOT n";
cout << " !1 = " << !1 << endl;
cout << " !0 = " << !0 << endl << "n";
return (0);
}
// Modul 4-3
// Operator Bitwise
#include <iostream>
using namespace std;
int main()
{
int U, V, W;
U = 1 << 1;
V = 1 << 2;
W = 1 << 3;
cout << "1 << 1 = " << U << endl;
cout << "1 << 2 = " << V << endl;
cout << "2 << 3 = " << W << endl << endl;
int X, Y, Z;
X = 16 >> 1;
Y = 16 >> 2;
Z = 16 >> 3;
cout << "16 >> 1 = " << X << endl;
cout << "16 >> 2 = " << Y << endl;
cout << "16 >> 3 = " << Z << endl << endl;
int A = 1;
int B = 0;
cout << "A = " << A << endl;
cout << "B = " << B << endl;
cout << "!A = " << !A << endl;
cout << "!B = " << !B << endl;
cout << "A & B = " << (A & B) << endl;
cout << "A | B = " << (A | B) << endl;
cout << "A ^ B = " << (A ^ B) << endl << endl;
return 0;
}
// modul 4-4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int X;
cout << "Masukkan Nilai X = ";
cin >> X;
cout << 'n';
X = (X < 0) ? -X : X;
cout << "|X| = " << X;
cout << "n n";
return 0;
}
//project 5-1 : Pencabangan IF
// Nama : Dendi
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout << "Kelulusan Siswa n n";
double Nilai_Ujian;
cout << "Masukkan Nilai Ujian : ";
cin >> Nilai_Ujian;
cout << endl;
char Hasil_Ujian[12] = "Tidak Lulus";
if (Nilai_Ujian >= 60)
strcpy (Hasil_Ujian, "Lulus");
cout << "Hasil Ujian : "
<< Hasil_Ujian
<< endl << endl;
return (0);
}
// Project 5-2 : Pencabangan Dua Kondisi (IF_ELSE)
// Nama : Dendi Riadi
#include <iostream>
using namespace std;
int main()
{
cout << "KELULUSAN SISWA n n ";
double Nilai_Ujian;
cout << "Msukkan Nilai Ujian : ";
cin >> Nilai_Ujian;
cout << endl;
if (Nilai_Ujian >= 60)
{
cout << ("Hasil Ujian = LULUS")
<< endl << endl;
}
else
{
cout << "Hasil Ujian = TIDAK LULUS"
<< endl << endl;
}
return (0);
}
//modul 5-3 : pencabangan IF bersarang
// Nama : Dendi Riadi
#include <iostream>
using namespace std;
int main()
{
double Nilai_Ujian;
char Indeks;
cout << " KONVERSI NILAI SISWA n n";
cout << " Masukkan Nilai Ujian : ";
cin >> Nilai_Ujian;
cout << endl;
if (Nilai_Ujian >= 85){
Indeks = 'A';}
else
if (Nilai_Ujian >= 75){
Indeks = 'B';}
else
if (Nilai_Ujian >= 55){
Indeks = 'C';}
else
if (Nilai_Ujian >= 40){
Indeks = 'D';}
else
{
Indeks = 'E';}
cout << "Indeks Siswa = " << Indeks << endl;
return (0);
}
// Project 5-4 : Pernyataan Switch
// Nama : Dendi Riadi
#include <iostream>
using namespace std;
int main ()
{
int pilihan;
cout << "Staff pengajar pemrograman C++ :" << endl;
cout << "================================" << endl;
cout << "1. Dr. Ary Setijadi Prihatmanto" << endl;
cout << "2. Dr. Aciek Ida Wuryandarin";
cout << "3. Dr. Pranoto Rusmin";
cout << "n4. Hendrayana, MT" << endl;
cout << "5. Marisa Paryasto, MT" << endl;
cout << "6. Kusprasapta Mutijarsa, MT" << endl;
cout << "7. Syahban Rangkuti, MT" << endl;
cout << "8. Reza Darmakusuma, MT" << endl;
cout << "9. Ferlin Ashadi, MTn";
cout << "10.Amiratusyadiah, MT" << endl << endl;
cout << "Staff pengajar Pemrograman C++ : ";
cin >> pilihan;
cout << endl;
switch (pilihan)
{
case 1:
cout << "Pilihan anda salahn" << endl;
break;
case 2:
cout << "Pilihan anda benarn" << endl;
break;
case 3:
cout << "Pilihan anda salahn" << endl;
break;
case 4:
cout << "Pilihan anda salahn" << endl;
break;
case 5:
cout << "Pilihan anda benarn" << endl;
break;
case 6:
cout << "Pilihan anda salahn" << endl;
break;
case 7:
cout << "Pilihan anda benarn" << endl;
break;
case 8:
cout << "Pilihan anda benarn" << endl;
break;
case 9:
cout << "Pilihan anda salahn" << endl;
break;
case 10:
cout << "Pilihan anda benarn" << endl;
break;
default:
cout << "Pilihan anda tidak ada dalam daftarnn";
}
return (0);
}
// Modul 6-1
// Nama : Dendi Riadi
#include <iostream>
using namespace std;
int main()
{
int pencacah = 1;
do
{
cout << " D4 - Teknologi Media Digital n" ;
pencacah++ ;
}
while (pencacah <= 10);
return (0);
}
// modul 6-2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int pencacah = 1;
do
{
cout << " TEKNIK KOMPUTER & MULTIMEDIA n" << endl;
cout << " POLITEKNIK PAJAJARAN n" << endl << endl;
pencacah++ ;
}
while (pencacah <=6);
return 0;
}
// modul 6-3.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout << "PENGULANGAN MENAIK" << endl;
for (int C=0; C<10; C++){
cout << C+1 << endl;
}
cout << 'n';
cout << "PENGULANGAN MENURUN " << endl;
for (int D=10; D>0; D--){
cout << D << endl;
}
return 0;
}
// modul 6-4.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
for (int j=1; j<=10; j++){
for (int k=1; k<=j; k++){
cout << k*j << ' ';
}
cout << 'n';
}
return 0;
}

More Related Content

What's hot

EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6 Manoj Kumar
Ā 
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQAFest
Ā 
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
(Rx).NET' way of async programming (.NET summit 2017 Belarus)(Rx).NET' way of async programming (.NET summit 2017 Belarus)
(Rx).NET' way of async programming (.NET summit 2017 Belarus)Stas Rivkin
Ā 
Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018Stas Rivkin
Ā 
How to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftHow to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftGiordano Scalzo
Ā 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using csnsanth
Ā 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?Carlos Alonso PĆ©rez
Ā 
ŠŠ»ŠµŠŗсŠµŠ¹ ŠšŃƒŃ‚ŃƒŠ¼Š¾Š², Coroutines everywhere
ŠŠ»ŠµŠŗсŠµŠ¹ ŠšŃƒŃ‚ŃƒŠ¼Š¾Š², Coroutines everywhereŠŠ»ŠµŠŗсŠµŠ¹ ŠšŃƒŃ‚ŃƒŠ¼Š¾Š², Coroutines everywhere
ŠŠ»ŠµŠŗсŠµŠ¹ ŠšŃƒŃ‚ŃƒŠ¼Š¾Š², Coroutines everywhereSergey Platonov
Ā 
é€£é‚¦ć®ē™½ć„ćƒ¤ćƒ„ 怌Objective-C怍
é€£é‚¦ć®ē™½ć„ćƒ¤ćƒ„ 怌Objective-Cć€é€£é‚¦ć®ē™½ć„ćƒ¤ćƒ„ 怌Objective-C怍
é€£é‚¦ć®ē™½ć„ćƒ¤ćƒ„ 怌Objective-C怍matuura_core
Ā 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeCory Forsyth
Ā 
Letswift19-clean-architecture
Letswift19-clean-architectureLetswift19-clean-architecture
Letswift19-clean-architectureJung Kim
Ā 
Useful c programs
Useful c programsUseful c programs
Useful c programsMD SHAH FAHAD
Ā 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6FITC
Ā 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations DVClub
Ā 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
Ā 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureOdoo
Ā 
IntroducciĆ³n a Elixir
IntroducciĆ³n a ElixirIntroducciĆ³n a Elixir
IntroducciĆ³n a ElixirSvet Ivantchev
Ā 

What's hot (20)

ECMAScript 6
ECMAScript 6ECMAScript 6
ECMAScript 6
Ā 
EcmaScript 6
EcmaScript 6 EcmaScript 6
EcmaScript 6
Ā 
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While TestingQA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
Ā 
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
(Rx).NET' way of async programming (.NET summit 2017 Belarus)(Rx).NET' way of async programming (.NET summit 2017 Belarus)
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
Ā 
Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018Rx.NET, from the inside out - Codemotion 2018
Rx.NET, from the inside out - Codemotion 2018
Ā 
How to Clone Flappy Bird in Swift
How to Clone Flappy Bird in SwiftHow to Clone Flappy Bird in Swift
How to Clone Flappy Bird in Swift
Ā 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using c
Ā 
Ruby closures, how are they possible?
Ruby closures, how are they possible?Ruby closures, how are they possible?
Ruby closures, how are they possible?
Ā 
Developing iOS apps with Swift
Developing iOS apps with SwiftDeveloping iOS apps with Swift
Developing iOS apps with Swift
Ā 
ŠŠ»ŠµŠŗсŠµŠ¹ ŠšŃƒŃ‚ŃƒŠ¼Š¾Š², Coroutines everywhere
ŠŠ»ŠµŠŗсŠµŠ¹ ŠšŃƒŃ‚ŃƒŠ¼Š¾Š², Coroutines everywhereŠŠ»ŠµŠŗсŠµŠ¹ ŠšŃƒŃ‚ŃƒŠ¼Š¾Š², Coroutines everywhere
ŠŠ»ŠµŠŗсŠµŠ¹ ŠšŃƒŃ‚ŃƒŠ¼Š¾Š², Coroutines everywhere
Ā 
é€£é‚¦ć®ē™½ć„ćƒ¤ćƒ„ 怌Objective-C怍
é€£é‚¦ć®ē™½ć„ćƒ¤ćƒ„ 怌Objective-Cć€é€£é‚¦ć®ē™½ć„ćƒ¤ćƒ„ 怌Objective-C怍
é€£é‚¦ć®ē™½ć„ćƒ¤ćƒ„ 怌Objective-C怍
Ā 
Explaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to ComeExplaining ES6: JavaScript History and What is to Come
Explaining ES6: JavaScript History and What is to Come
Ā 
Letswift19-clean-architecture
Letswift19-clean-architectureLetswift19-clean-architecture
Letswift19-clean-architecture
Ā 
Useful c programs
Useful c programsUseful c programs
Useful c programs
Ā 
An Intro To ES6
An Intro To ES6An Intro To ES6
An Intro To ES6
Ā 
Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations Architecture for Massively Parallel HDL Simulations
Architecture for Massively Parallel HDL Simulations
Ā 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6
Ā 
How to Create a l10n Payroll Structure
How to Create a l10n Payroll StructureHow to Create a l10n Payroll Structure
How to Create a l10n Payroll Structure
Ā 
IntroducciĆ³n a Elixir
IntroducciĆ³n a ElixirIntroducciĆ³n a Elixir
IntroducciĆ³n a Elixir
Ā 
Web lab programs
Web lab programsWeb lab programs
Web lab programs
Ā 

Viewers also liked

Bracket Busting: Predicting the College Basketball Tournament with Social Media
Bracket Busting: Predicting the College Basketball Tournament with Social MediaBracket Busting: Predicting the College Basketball Tournament with Social Media
Bracket Busting: Predicting the College Basketball Tournament with Social MediaMohamed Mahdy
Ā 
Foxpro
FoxproFoxpro
Foxproarhas1970
Ā 
Bahasa Pemrograman C++
Bahasa Pemrograman C++Bahasa Pemrograman C++
Bahasa Pemrograman C++Rangga Ananto
Ā 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_htmlSayed Ahmed
Ā 
Proyek 3 proyek web html menggunakan notepad
Proyek 3 proyek web html menggunakan notepadProyek 3 proyek web html menggunakan notepad
Proyek 3 proyek web html menggunakan notepadhestihariani
Ā 
Pemrograman web dengan php my sql
Pemrograman web dengan php my sqlPemrograman web dengan php my sql
Pemrograman web dengan php my sqlHerry Mardiyanto
Ā 
Webdesign Gestaltungsgrundlagen fĆ¼r Nicht-Designer, Normales und Entwickler
Webdesign Gestaltungsgrundlagen fĆ¼r Nicht-Designer, Normales und EntwicklerWebdesign Gestaltungsgrundlagen fĆ¼r Nicht-Designer, Normales und Entwickler
Webdesign Gestaltungsgrundlagen fĆ¼r Nicht-Designer, Normales und EntwicklerDaniela Wibbeke
Ā 
Web designp pt
Web designp ptWeb designp pt
Web designp ptBizzyb09
Ā 
Proyek web html menggunakan notepad
Proyek web html menggunakan notepadProyek web html menggunakan notepad
Proyek web html menggunakan notepadSamsuri14
Ā 
Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Seo_Yun
Ā 
Analisis dan perancangan sistem informasi
Analisis dan perancangan sistem informasiAnalisis dan perancangan sistem informasi
Analisis dan perancangan sistem informasiDyah Ayu Damayanti
Ā 
Visual foxpro
Visual foxproVisual foxpro
Visual foxproRigo Silva
Ā 
Modul web design - studi kasus website portal berita
Modul web design - studi kasus website portal beritaModul web design - studi kasus website portal berita
Modul web design - studi kasus website portal beritaDoni Andriansyah
Ā 
Html Ppt
Html PptHtml Ppt
Html Pptvijayanit
Ā 
Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Ollie Ollie
Ā 

Viewers also liked (17)

Bracket Busting: Predicting the College Basketball Tournament with Social Media
Bracket Busting: Predicting the College Basketball Tournament with Social MediaBracket Busting: Predicting the College Basketball Tournament with Social Media
Bracket Busting: Predicting the College Basketball Tournament with Social Media
Ā 
Foxpro
FoxproFoxpro
Foxpro
Ā 
Bahasa Pemrograman C++
Bahasa Pemrograman C++Bahasa Pemrograman C++
Bahasa Pemrograman C++
Ā 
Web design and_html
Web design and_htmlWeb design and_html
Web design and_html
Ā 
Proyek 3 proyek web html menggunakan notepad
Proyek 3 proyek web html menggunakan notepadProyek 3 proyek web html menggunakan notepad
Proyek 3 proyek web html menggunakan notepad
Ā 
Pemrograman web dengan php my sql
Pemrograman web dengan php my sqlPemrograman web dengan php my sql
Pemrograman web dengan php my sql
Ā 
Webdesign Gestaltungsgrundlagen fĆ¼r Nicht-Designer, Normales und Entwickler
Webdesign Gestaltungsgrundlagen fĆ¼r Nicht-Designer, Normales und EntwicklerWebdesign Gestaltungsgrundlagen fĆ¼r Nicht-Designer, Normales und Entwickler
Webdesign Gestaltungsgrundlagen fĆ¼r Nicht-Designer, Normales und Entwickler
Ā 
Web designp pt
Web designp ptWeb designp pt
Web designp pt
Ā 
Proyek web html menggunakan notepad
Proyek web html menggunakan notepadProyek web html menggunakan notepad
Proyek web html menggunakan notepad
Ā 
Formularios En Visual Fox Pro
Formularios En Visual Fox ProFormularios En Visual Fox Pro
Formularios En Visual Fox Pro
Ā 
Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0
Ā 
Analisis dan perancangan sistem informasi
Analisis dan perancangan sistem informasiAnalisis dan perancangan sistem informasi
Analisis dan perancangan sistem informasi
Ā 
Visual foxpro
Visual foxproVisual foxpro
Visual foxpro
Ā 
Web design
Web designWeb design
Web design
Ā 
Modul web design - studi kasus website portal berita
Modul web design - studi kasus website portal beritaModul web design - studi kasus website portal berita
Modul web design - studi kasus website portal berita
Ā 
Html Ppt
Html PptHtml Ppt
Html Ppt
Ā 
Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0Tutorial Microsoft Visual FoxPro 9.0
Tutorial Microsoft Visual FoxPro 9.0
Ā 

Similar to Tugas praktikukm pemrograman c++

ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.pptLokeshK66
Ā 
Project in programming
Project in programmingProject in programming
Project in programmingsahashi11342091
Ā 
C++ practical
C++ practicalC++ practical
C++ practicalRahul juneja
Ā 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6phoe3
Ā 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solvingSyed Umair
Ā 
Algoritma 5 november wiwik p.l
Algoritma 5 november wiwik p.lAlgoritma 5 november wiwik p.l
Algoritma 5 november wiwik p.lWiwik Puji Lestarii
Ā 
Oop lab report
Oop lab reportOop lab report
Oop lab reportkhasmanjalali
Ā 
Contoh program c++ kalkulator
Contoh program c++ kalkulatorContoh program c++ kalkulator
Contoh program c++ kalkulatorJsHomeIndustry
Ā 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfyamew16788
Ā 
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docxkatherncarlyle
Ā 

Similar to Tugas praktikukm pemrograman c++ (20)

ch5_additional.ppt
ch5_additional.pptch5_additional.ppt
ch5_additional.ppt
Ā 
Project in programming
Project in programmingProject in programming
Project in programming
Ā 
C++ practical
C++ practicalC++ practical
C++ practical
Ā 
Laporan pd kelompok 6
Laporan pd kelompok 6Laporan pd kelompok 6
Laporan pd kelompok 6
Ā 
C++ TUTORIAL 3
C++ TUTORIAL 3C++ TUTORIAL 3
C++ TUTORIAL 3
Ā 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
Ā 
C++ L05-Functions
C++ L05-FunctionsC++ L05-Functions
C++ L05-Functions
Ā 
Ch7 C++
Ch7 C++Ch7 C++
Ch7 C++
Ā 
Oops presentation
Oops presentationOops presentation
Oops presentation
Ā 
Pointers
PointersPointers
Pointers
Ā 
P1
P1P1
P1
Ā 
C++ TUTORIAL 2
C++ TUTORIAL 2C++ TUTORIAL 2
C++ TUTORIAL 2
Ā 
Include
IncludeInclude
Include
Ā 
Algoritma 5 november wiwik p.l
Algoritma 5 november wiwik p.lAlgoritma 5 november wiwik p.l
Algoritma 5 november wiwik p.l
Ā 
Oop lab report
Oop lab reportOop lab report
Oop lab report
Ā 
3 rd animation
3 rd animation3 rd animation
3 rd animation
Ā 
Contoh program c++ kalkulator
Contoh program c++ kalkulatorContoh program c++ kalkulator
Contoh program c++ kalkulator
Ā 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
Ā 
C++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdfC++ Nested loops, matrix and fuctions.pdf
C++ Nested loops, matrix and fuctions.pdf
Ā 
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
#define ENABLE_COMMANDER#define ENABLE_REPORTER#include c.docx
Ā 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜RTylerCroy
Ā 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
Ā 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
Ā 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
Ā 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
Ā 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
Ā 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
Ā 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
Ā 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
Ā 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
Ā 
šŸ¬ The future of MySQL is Postgres šŸ˜
šŸ¬  The future of MySQL is Postgres   šŸ˜šŸ¬  The future of MySQL is Postgres   šŸ˜
šŸ¬ The future of MySQL is Postgres šŸ˜
Ā 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Ā 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
Ā 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
Ā 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
Ā 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Ā 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Ā 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
Ā 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
Ā 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Ā 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Ā 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Ā 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Ā 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Ā 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Ā 

Tugas praktikukm pemrograman c++

  • 1. TUGAS PRAKTIKUKM MICROSOFT VISUAL STUDIO PEMROGRAMAN C++ DENDI RIADI : TEKNIK KOMPUTER KARYAWAN SEMESTER 4 /* ========================================================= Program Pertama microsoft visual studio 2010 Modul 1 Nama : Dendi Riadi =========================================================*/ #include <iostream> //preprosesor int main() // fungsi main { std::cout << "Ini adalah pertama sayan"; std::cout << "Dengan menggunakan Microsoft Visual Studio C++.n"; return 0; } // modul 2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> int _tmain(int argc, _TCHAR* argv[]) { std::cout << "ini program kedua saya n"; std::cout << "Menggunakan visual C++." << std::endl; return 0; } //modul 1-3 #include <iostream> using namespace std; int main() { char tampilkan[1]; char panjang_data[50]; cout << "================================================ n"; cout << " BELAJAR PEMROGRAMAN C++ n"; cout << "================================================ n"; cout << " NAMA : "; cin.getline (panjang_data,50); cout << " JURUSAN : Teknik Komputer POLITEKNIK PAJAJARAN " <<endl; cin.getline(tampilkan,1); return (0); } /* Modul 1.4 Belajar Syntax error ======================================= */ #include <iostream> using namespace std; int main()
  • 2. { cout << "+++++++++++++++++++++++++++++++++++++++++++ n"; cout << " Memepelajari Syntax errorr n"; cout << "+++++++++++++++++++++++++++++++++++++++++++ n"; cout << " Syntax error adalah kesalahan n"; cout << " Jangan lupa untuk melakukan perintah n"; cout << " Clean Solution yang berada pada n"; cout << " menu Build, sebelum mengkompilasi n"; cout << " program Microsoft Visual Studio C++ n"; return (0); } // modul 1-5 // limit.cpp #include <iostream> #include <limits> using namespace std; int main() { cout << " TIPE DATA n"; cout << "===============================n"; cout << " minimum char = " << CHAR_MIN << endl; cout << " maximum char = " << CHAR_MAX << endl; cout << " minimum signed char = " << SCHAR_MIN << endl; cout << " maximum signed char = " << SCHAR_MAX << endl; cout << " maximum unsigned char = " << UCHAR_MAX << endl; cout << " minimum short = " << SHRT_MIN << endl; cout << " maximum short = " << SHRT_MAX << endl; cout << " minimum int = " << INT_MIN << endl; cout << " maximum int = " << INT_MAX << endl; cout << " minimum long = " << LONG_MIN << endl; cout << " maximum long = " << LONG_MAX << endl; cout << " maximum unsigned short="<<USHRT_MAX<<endl; cout << " maximum unsigned = " << UINT_MAX << endl; cout << " maximum unsigned long ="<<ULONG_MAX<<endl; return (0); } // Modul 2-1 // Tipe data dasar.cpp #include <iostream> 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.123; cout << "Contoh Nilai Tipe Bilangan Riil Y = " << Y << endl << endl; char Karakter = 'A';
  • 3. char* Teks = "Kata"; char TEKS[39] = "Teks dengan batas sebanyak 39 karakter"; cout << Karakter << endl; cout << Teks << endl; cout << TEKS << endl << endl; return (0); } //Modul 2-2 //Konversi type data #include <iostream> using namespace std; int main() { char Karakter = 'D'; cout << "Karakter D = " << Karakter << endl; cout << "Nilai ASCII = " << (int) Karakter << endl; return (0); } // Modul 2-3 // Konstanta #include <iostream> using namespace std; const int MAX = 10; int main() { int A[MAX]; for (int C = 0; C < MAX; C++) { A[C] = C * 7; } for (int c = 0; c < MAX; c++) { cout << A [c] << endl; } return (0); } // modul 2-4 // variabel global & lokal #include <iostream> using namespace std; int A; int main() { A = 10;
  • 4. cout << " Nilai variabel A = " << A << endl << endl; int B; B = 300; cout << " Nilai Variabel B = " << B << endl << endl; return (0); } //Modul 3-1 //Operator Assignment #include <iostream> using namespace std; int main() { int a,b; a = 20; b = 100; a = b; b = 7; cout << "a = "; cout << a; cout << endl; cout << "b = "; cout << b; cout << endl; return (0); } // modul 3-2 // operator unary #include <iostream> using namespace std; int main() { int e,g; double f,h; e = +8; f = -3.14; cout << "Nilai e : " << e << endl; cout << "Nilai f : " << f << endl; g = -e; h = -f; cout << "Nilai g : " << g << endl; cout << "Nilai h : " << h << endl; return (0);
  • 5. } // modul 3-3 // increment #include <iostream> using namespace std; int main() { int i,j; i = 5; cout << "Nilai i awal : " << i << endl; cout << "Nilai ++i : " << ++i << endl; cout << "Nilai i akhir : " << i << endl; cout << 'n'; j = 10; cout << "Nilai j awal : " << j << endl; cout << "Nilai ++j : " << ++j << endl; cout << "Nilai j akhir : " << j << endl; cout << 'n'; return (0); } // modul 3-4 // decrement #include <iostream> using namespace std; int main() { int k; float l; k = 100; l = 10.5; cout << "Nilai k awal : " << k << endl; cout << "Nilai --k : " << --k << endl; cout << "Nilai k akhir : " << k << endl; cout << 'n'; cout << "Nilai l awal : " << l << endl; cout << "Nilai l-- : " << l-- << endl; cout << "Nilai l akhir : " << l << endl; return (0); } //modul 4-1 //operator aritmatika #include <iostream> using namespace std;
  • 6. int main() { cout << "2 + 3 = " << 2 + 3 << endl << endl; cout << "10 - 5 = " << 10 - 5 << endl << endl; cout << "4 x 3 = " << 4 * 3 << endl << endl; cout << "4 / 2 = " << 4 / 2 << endl << endl; cout << "10 % 3 = " << 10 % 3 << endl << endl; return (0); } // modul 4-2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { std::cout << " OPERASI OPERATOR LOGIKA n"; cout << "n Tabel Kebenaran operator AND n"; cout << " 1 && 1 = " << (1 && 1) << endl; cout << " 1 && 0 = " << (1 && 0) << endl; cout << " 0 && 1 = " << (0 && 1) << endl; cout << " 0 && 0 = " << (0 && 0) << endl; cout << "n Tabel Kebenaran operator OR n"; cout << " 1 || 1 = " << (1 || 1) << endl; cout << " 1 || 0 = " << (1 || 0) << endl; cout << " 0 || 1 = " << (0 || 1) << endl; cout << " 0 || 0 = " << (0 || 0) << endl; cout << "n Tabel Kebenaran operator NOT n"; cout << " !1 = " << !1 << endl; cout << " !0 = " << !0 << endl << "n"; return (0); } // Modul 4-3 // Operator Bitwise #include <iostream> using namespace std; int main() { int U, V, W; U = 1 << 1;
  • 7. V = 1 << 2; W = 1 << 3; cout << "1 << 1 = " << U << endl; cout << "1 << 2 = " << V << endl; cout << "2 << 3 = " << W << endl << endl; int X, Y, Z; X = 16 >> 1; Y = 16 >> 2; Z = 16 >> 3; cout << "16 >> 1 = " << X << endl; cout << "16 >> 2 = " << Y << endl; cout << "16 >> 3 = " << Z << endl << endl; int A = 1; int B = 0; cout << "A = " << A << endl; cout << "B = " << B << endl; cout << "!A = " << !A << endl; cout << "!B = " << !B << endl; cout << "A & B = " << (A & B) << endl; cout << "A | B = " << (A | B) << endl; cout << "A ^ B = " << (A ^ B) << endl << endl; return 0; } // modul 4-4.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int X; cout << "Masukkan Nilai X = "; cin >> X; cout << 'n'; X = (X < 0) ? -X : X; cout << "|X| = " << X; cout << "n n"; return 0; } //project 5-1 : Pencabangan IF // Nama : Dendi #include <iostream> #include <string> using namespace std; int main() { cout << "Kelulusan Siswa n n"; double Nilai_Ujian; cout << "Masukkan Nilai Ujian : ";
  • 8. cin >> Nilai_Ujian; cout << endl; char Hasil_Ujian[12] = "Tidak Lulus"; if (Nilai_Ujian >= 60) strcpy (Hasil_Ujian, "Lulus"); cout << "Hasil Ujian : " << Hasil_Ujian << endl << endl; return (0); } // Project 5-2 : Pencabangan Dua Kondisi (IF_ELSE) // Nama : Dendi Riadi #include <iostream> using namespace std; int main() { cout << "KELULUSAN SISWA n n "; double Nilai_Ujian; cout << "Msukkan Nilai Ujian : "; cin >> Nilai_Ujian; cout << endl; if (Nilai_Ujian >= 60) { cout << ("Hasil Ujian = LULUS") << endl << endl; } else { cout << "Hasil Ujian = TIDAK LULUS" << endl << endl; } return (0); } //modul 5-3 : pencabangan IF bersarang // Nama : Dendi Riadi #include <iostream> using namespace std; int main() { double Nilai_Ujian; char Indeks; cout << " KONVERSI NILAI SISWA n n"; cout << " Masukkan Nilai Ujian : "; cin >> Nilai_Ujian; cout << endl; if (Nilai_Ujian >= 85){ Indeks = 'A';} else
  • 9. if (Nilai_Ujian >= 75){ Indeks = 'B';} else if (Nilai_Ujian >= 55){ Indeks = 'C';} else if (Nilai_Ujian >= 40){ Indeks = 'D';} else { Indeks = 'E';} cout << "Indeks Siswa = " << Indeks << endl; return (0); } // Project 5-4 : Pernyataan Switch // Nama : Dendi Riadi #include <iostream> using namespace std; int main () { int pilihan; cout << "Staff pengajar pemrograman C++ :" << endl; cout << "================================" << endl; cout << "1. Dr. Ary Setijadi Prihatmanto" << endl; cout << "2. Dr. Aciek Ida Wuryandarin"; cout << "3. Dr. Pranoto Rusmin"; cout << "n4. Hendrayana, MT" << endl; cout << "5. Marisa Paryasto, MT" << endl; cout << "6. Kusprasapta Mutijarsa, MT" << endl; cout << "7. Syahban Rangkuti, MT" << endl; cout << "8. Reza Darmakusuma, MT" << endl; cout << "9. Ferlin Ashadi, MTn"; cout << "10.Amiratusyadiah, MT" << endl << endl; cout << "Staff pengajar Pemrograman C++ : "; cin >> pilihan; cout << endl; switch (pilihan) { case 1: cout << "Pilihan anda salahn" << endl; break; case 2: cout << "Pilihan anda benarn" << endl; break; case 3: cout << "Pilihan anda salahn" << endl; break; case 4: cout << "Pilihan anda salahn" << endl; break; case 5: cout << "Pilihan anda benarn" << endl; break; case 6: cout << "Pilihan anda salahn" << endl; break; case 7:
  • 10. cout << "Pilihan anda benarn" << endl; break; case 8: cout << "Pilihan anda benarn" << endl; break; case 9: cout << "Pilihan anda salahn" << endl; break; case 10: cout << "Pilihan anda benarn" << endl; break; default: cout << "Pilihan anda tidak ada dalam daftarnn"; } return (0); } // Modul 6-1 // Nama : Dendi Riadi #include <iostream> using namespace std; int main() { int pencacah = 1; do { cout << " D4 - Teknologi Media Digital n" ; pencacah++ ; } while (pencacah <= 10); return (0); } // modul 6-2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int pencacah = 1; do { cout << " TEKNIK KOMPUTER & MULTIMEDIA n" << endl; cout << " POLITEKNIK PAJAJARAN n" << endl << endl; pencacah++ ; } while (pencacah <=6); return 0; } // modul 6-3.cpp : Defines the entry point for the console application. // #include "stdafx.h"
  • 11. #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { cout << "PENGULANGAN MENAIK" << endl; for (int C=0; C<10; C++){ cout << C+1 << endl; } cout << 'n'; cout << "PENGULANGAN MENURUN " << endl; for (int D=10; D>0; D--){ cout << D << endl; } return 0; } // modul 6-4.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { for (int j=1; j<=10; j++){ for (int k=1; k<=j; k++){ cout << k*j << ' '; } cout << 'n'; } return 0; }