SlideShare a Scribd company logo
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 (20)

PDF
ECMAScript 6
Piotr Lewandowski
 
ODP
EcmaScript 6
Manoj Kumar
 
PPTX
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QAFest
 
PPTX
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
Stas Rivkin
 
PPTX
Rx.NET, from the inside out - Codemotion 2018
Stas Rivkin
 
PDF
How to Clone Flappy Bird in Swift
Giordano Scalzo
 
DOC
Program for hamming code using c
snsanth
 
PDF
Ruby closures, how are they possible?
Carlos Alonso Pérez
 
PPT
Developing iOS apps with Swift
New Generation Applications
 
PDF
Алексей Кутумов, Coroutines everywhere
Sergey Platonov
 
KEY
連邦の白いヤツ 「Objective-C」
matuura_core
 
PDF
Explaining ES6: JavaScript History and What is to Come
Cory Forsyth
 
PDF
Letswift19-clean-architecture
Jung Kim
 
DOC
Useful c programs
MD SHAH FAHAD
 
PDF
An Intro To ES6
FITC
 
PDF
Architecture for Massively Parallel HDL Simulations
DVClub
 
PDF
FalsyValues. Dmitry Soshnikov - ECMAScript 6
Dmitry Soshnikov
 
PDF
How to Create a l10n Payroll Structure
Odoo
 
PDF
Introducción a Elixir
Svet Ivantchev
 
DOCX
Web lab programs
SRINIVASUNIVERSITYEN
 
ECMAScript 6
Piotr Lewandowski
 
EcmaScript 6
Manoj Kumar
 
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
QAFest
 
(Rx).NET' way of async programming (.NET summit 2017 Belarus)
Stas Rivkin
 
Rx.NET, from the inside out - Codemotion 2018
Stas Rivkin
 
How to Clone Flappy Bird in Swift
Giordano Scalzo
 
Program for hamming code using c
snsanth
 
Ruby closures, how are they possible?
Carlos Alonso Pérez
 
Developing iOS apps with Swift
New Generation Applications
 
Алексей Кутумов, Coroutines everywhere
Sergey Platonov
 
連邦の白いヤツ 「Objective-C」
matuura_core
 
Explaining ES6: JavaScript History and What is to Come
Cory Forsyth
 
Letswift19-clean-architecture
Jung Kim
 
Useful c programs
MD SHAH FAHAD
 
An Intro To ES6
FITC
 
Architecture for Massively Parallel HDL Simulations
DVClub
 
FalsyValues. Dmitry Soshnikov - ECMAScript 6
Dmitry Soshnikov
 
How to Create a l10n Payroll Structure
Odoo
 
Introducción a Elixir
Svet Ivantchev
 
Web lab programs
SRINIVASUNIVERSITYEN
 

Viewers also liked (17)

PDF
Bracket Busting: Predicting the College Basketball Tournament with Social Media
Mohamed Mahdy
 
PDF
Foxpro
arhas1970
 
PPTX
Bahasa Pemrograman C++
Rangga Ananto
 
PPTX
Web design and_html
Sayed Ahmed
 
PPTX
Proyek 3 proyek web html menggunakan notepad
hestihariani
 
PDF
Pemrograman web dengan php my sql
Herry Mardiyanto
 
PDF
Webdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und Entwickler
Daniela Wibbeke
 
PPTX
Web designp pt
Bizzyb09
 
PPTX
Proyek web html menggunakan notepad
Samsuri14
 
PPSX
Formularios En Visual Fox Pro
maricela maldonado morales
 
PDF
Tutorial Microsoft Visual FoxPro 9.0
Seo_Yun
 
PDF
Analisis dan perancangan sistem informasi
Dyah Ayu Damayanti
 
PPTX
Visual foxpro
Rigo Silva
 
PPT
Web design
Sony Prolink
 
PDF
Modul web design - studi kasus website portal berita
Doni Andriansyah
 
PPT
Html Ppt
vijayanit
 
PDF
Tutorial Microsoft Visual FoxPro 9.0
Ollie Ollie
 
Bracket Busting: Predicting the College Basketball Tournament with Social Media
Mohamed Mahdy
 
Foxpro
arhas1970
 
Bahasa Pemrograman C++
Rangga Ananto
 
Web design and_html
Sayed Ahmed
 
Proyek 3 proyek web html menggunakan notepad
hestihariani
 
Pemrograman web dengan php my sql
Herry Mardiyanto
 
Webdesign Gestaltungsgrundlagen für Nicht-Designer, Normales und Entwickler
Daniela Wibbeke
 
Web designp pt
Bizzyb09
 
Proyek web html menggunakan notepad
Samsuri14
 
Formularios En Visual Fox Pro
maricela maldonado morales
 
Tutorial Microsoft Visual FoxPro 9.0
Seo_Yun
 
Analisis dan perancangan sistem informasi
Dyah Ayu Damayanti
 
Visual foxpro
Rigo Silva
 
Web design
Sony Prolink
 
Modul web design - studi kasus website portal berita
Doni Andriansyah
 
Html Ppt
vijayanit
 
Tutorial Microsoft Visual FoxPro 9.0
Ollie Ollie
 
Ad

Similar to Tugas praktikukm pemrograman c++ (20)

PPT
ch5_additional.ppt
LokeshK66
 
PPTX
Project in programming
sahashi11342091
 
PDF
C++ practical
Rahul juneja
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 5
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
DOCX
Laporan pd kelompok 6
phoe3
 
PDF
C++ TUTORIAL 3
Farhan Ab Rahman
 
DOCX
Assignement of programming & problem solving
Syed Umair
 
PDF
C++ L05-Functions
Mohammad Shaker
 
PDF
Object Oriented Programming (OOP) using C++ - Lecture 2
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
PPTX
Oops presentation
sushamaGavarskar1
 
PDF
Pointers
Hitesh Wagle
 
PDF
C++ TUTORIAL 2
Farhan Ab Rahman
 
DOCX
Include
Shi Chakep
 
DOCX
Algoritma 5 november wiwik p.l
Wiwik Puji Lestarii
 
PPTX
Lec 2.pptx programing errors \basic of programing
daoodkhan4177
 
DOCX
Oop lab report
khasmanjalali
 
PDF
3 rd animation
divyalakshmi77
 
PDF
Contoh program c++ kalkulator
JsHomeIndustry
 
ch5_additional.ppt
LokeshK66
 
Project in programming
sahashi11342091
 
C++ practical
Rahul juneja
 
Object Oriented Programming (OOP) using C++ - Lecture 5
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Laporan pd kelompok 6
phoe3
 
C++ TUTORIAL 3
Farhan Ab Rahman
 
Assignement of programming & problem solving
Syed Umair
 
C++ L05-Functions
Mohammad Shaker
 
Object Oriented Programming (OOP) using C++ - Lecture 2
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
 
Oops presentation
sushamaGavarskar1
 
Pointers
Hitesh Wagle
 
C++ TUTORIAL 2
Farhan Ab Rahman
 
Include
Shi Chakep
 
Algoritma 5 november wiwik p.l
Wiwik Puji Lestarii
 
Lec 2.pptx programing errors \basic of programing
daoodkhan4177
 
Oop lab report
khasmanjalali
 
3 rd animation
divyalakshmi77
 
Contoh program c++ kalkulator
JsHomeIndustry
 
Ad

Recently uploaded (20)

PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PDF
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
PDF
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PPTX
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
PDF
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PPTX
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
PDF
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
NewMind AI Weekly Chronicles – July’25, Week III
NewMind AI
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Generative AI vs Predictive AI-The Ultimate Comparison Guide
Lily Clark
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
AVL ( audio, visuals or led ), technology.
Rajeshwri Panchal
 
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
Agile Chennai 18-19 July 2025 Ideathon | AI Powered Microfinance Literacy Gui...
AgileNetwork
 

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; }